Languages

Menu
Sites
Language
How Do I compile simeple appliaction like helloworld.c with toolchain?

 Hello. 

 I want to compile simple program like helloworld.c

 So I was installed tizen-sdk to my server Ubuntu 12.04 64bit. 

 And I use this command. 

# tizen-sdk/tools/arm-linux-gnueabi-gcc-4.5/bin/arm-linux-gnueabi-gcc helloworld.c -o helloworld   
work/test/helloworld.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated

So, How Do I compile simple program to use cross-compiler in tizen-sdk? 

 

 

Responses

2 Replies
Lakshmi Grandhi

Hi,

 

All the librarbies and includes will be available in rootstrapes include them in your command

 ./i386-linux-gnueabi-gcc -I/home/xxx/tizen-sdk/platforms/tizen2.2/rootstraps/tizen-device-2.2.native/usr/include/ -L/home/xxx/tizen-sdk/platforms/tizen2.2/rootstraps/tizen-device-2.2.native/usr/lib  helloworld.c   -o helloworld

 

Mahesh Lingsugur

Hi Geonho Kim,

To use the gcc directly from console, you need to provide all the direct and inter included header paths. You may refer an example of g++ build below:

Building file: ../src/aFormAppForm.cpp
Invoking: C++ Compiler
i386-linux-gnueabi-g++ -D_DEBUG -I"/home/maes.g/workspace/aFormApp/inc" -O0 -g3 -Wall -c -fmessage-length=0 -fPIE --sysroot="/home/maes.g/tizen-sdk/tools/smart-build-interface/../../platforms/tizen2.2/rootstraps/tizen-emulator-2.2.native" -I"/home/maes.g/tizen-sdk/tools/smart-build-interface/../../platforms/tizen2.2/rootstraps/tizen-emulator-2.2.native/usr/include/libxml2" -I"/home/maes.g/tizen-sdk/library" -I"/home/maes.g/tizen-sdk/tools/smart-build-interface/../../platforms/tizen2.2/rootstraps/tizen-emulator-2.2.native/usr/include" -I"/home/maes.g/tizen-sdk/tools/smart-build-interface/../../platforms/tizen2.2/rootstraps/tizen-emulator-2.2.native/usr/include/osp" -D_APP_LOG -MMD -MP -MF"src/aFormAppForm.d" -MT"src/aFormAppForm.d" -o "src/aFormAppForm.o" "../src/aFormAppForm.cpp"
Finished building: ../src/aFormAppForm.cpp


Building target: aFormApp.exe
Invoking: C++ Linker
i386-linux-gnueabi-g++ -o"aFormApp.exe" ./src/aFormAppForm.o -L"/home/maes.g/workspace/aFormApp/lib" -Xlinker --as-needed -pie -lpthread -Xlinker -rpath="/opt/usr/apps/qnwhDNbasj/lib" -Xlinker -rpath="/home/developer/sdk_tools/lib" --sysroot="/home/maes.g/tizen-sdk/tools/smart-build-interface/../../platforms/tizen2.2/rootstraps/tizen-emulator-2.2.native" -L"/home/maes.g/tizen-sdk/tools/smart-build-interface/../../platforms/tizen2.2/rootstraps/tizen-emulator-2.2.native/usr/lib" -L"/home/maes.g/tizen-sdk/tools/smart-build-interface/../../platforms/tizen2.2/rootstraps/tizen-emulator-2.2.native/usr/lib/osp" -losp-uifw -losp-appfw -losp-image -losp-json -losp-ime -losp-net -lpthread -losp-content -losp-locations -losp-telephony -losp-uix -losp-media -losp-messaging -losp-web -losp-social -losp-wifi -losp-bluetooth -losp-nfc -losp-face -losp-speech-tts -losp-speech-stt -losp-shell -losp-shell-core -losp-vision -lxml2 -lalut -lopenal
Finished building target: aFormApp.exe

 

You may use the CLI feature to avoid the manual overhead. Steps are as below:

1. Create a Tizen Proj, add your C or C++ source code

2. Right click and "Generate Command line configuration"

3. Open Console @ x/App/CommandLineBuild/

4. Enter the CLI script "native-make"