User forums > Embedded development
Create and compile Contiki project
Pavel_47:
Hello,
I wonder if somebody has succeeded to create and compile a Contiki project using Code::Blocks together with GNU GCC compiler for ARM.
When I tried a simple example from ../example/ subfolder, it was OK.
Then I added functionnality from one of ../apps/ subfolders.
Unfortunately relevant source file from a subfolder wasn't compiled despite it was included into project.
Help, please.
Thanks in advance.
Pavel
stahta01:
Post a Build Log.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Also, it will likely need the Code::Blocks (CB) Project (.cbp) attached to your next post to find the cause.
I am going to Gym right now so will NOT be available to help you till a later time.
Posting links to the Compiler download and the code examples you are Compiling will also help me to help you.
Tim S.
Pavel_47:
Hello Tim,
Thanks for feedback.
Here it is:
-------------- Build: Debug in cc2538dk (compiler: GNU GCC Compiler for ARM)---------------
Running command: make.exe -f Makefile
using saved target 'cc2538dk'
CC ../../cpu/cc2538/./ieee-addr.c
AR contiki-cc2538dk.a
CC ../../cpu/cc2538/cc2538.lds
CC ../../platform/cc2538dk/./startup-gcc.c
CC uIPv6_HOST.c
LD uIPv6_HOST.elf
uIPv6_HOST.co: In function `process_thread_button_process':
uIPv6_HOST.c:(.text.process_thread_button_process+0x2a): undefined reference to `servreg_hack_init'
uIPv6_HOST.c:(.text.process_thread_button_process+0x4a): undefined reference to `servreg_hack_lookup'
collect2.exe: error: ld returned 1 exit status
make: *** [uIPv6_HOST.elf] Error 1
../../cpu/cc2538/Makefile.cc2538:70: recipe for target 'uIPv6_HOST.elf' failed
rm uIPv6_HOST.co obj_cc2538dk/startup-gcc.o
Process terminated with status 2 (0 minute(s), 3 second(s))
3 error(s), 0 warning(s) (0 minute(s), 3 second(s))
Nevertheless the function server_hack_init is included in the project (please, see the image in attachment).
Regards
Pavel.
[attachment deleted by admin]
Vuki:
Normally CodeBlocks compiles all files in the project. However, your project is set to run make command instead. CodeBlocks does not have any control on the build process in this case, it simply runs make. Adding file to the project does nothing because Makefile is not updated automatically.
Solution: open Makefile and add the relevant source file to the list of compiled files. Better solution: create a new project (without make), add necessary files and options, etc.
Pavel_47:
Hello Vuki,
Thanks for feedback.
I've tried your suggestions - created new project, added necessary files and tried to compile.
Other problem appears - header files aren't seen by sources despite they does present.
Here is build output:
||=== Build: Debug in SERVER_HACK (compiler: GNU GCC Compiler for ARM) ===|
..\..\..\core\loader\cle.c|38|fatal error: contiki.h: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
And here is snapshot of project (image below). As you can state, contiki.h does present in the project.
Where I've been mistaken ?
Another question - original project was organized with virtual folders (in new project I dispensed with this option).
Can this detail be important for success of compilation/building ?
Regards
Pavel
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
Go to full version