User forums > Embedded development
Create and compile Contiki project
scarphin:
The header file 'contiki.h' in your screenshot is located in a different folder than the source file 'cle.c'. Usually files included with double quotes ("") are searched in the same folder of which the file includes them so the error is obvious. What you have to do is to enter the correct directories for the header files (or any other types of files if necessary) in the project settings. But be aware that you may end up with other problems if the makefile is a complex one in which case you have to insert all the other settings it contains into CB.
Pavel_47:
Hello Scarphin,
Thanks for feedback.
Is there some other way to proceed ... i.e. without adding prefixes into header declarations.
The problem is that the hierarchy is quite complex and number of files to process is huge.
The makefile I used for compilation is very simple. Here it's contents:
--- Code: ---DEFINES+=PROJECT_CONF_H=\"project-conf.h\"
CONTIKI_PROJECT = my_udp_client
all: $(CONTIKI_PROJECT)
CONTIKI = ../..
include $(CONTIKI)/Makefile.include
--- End code ---
What is complex is Makefile.include. Its size is 8k and its syntax is quite complex - instructions, flags, compilations.
It is situated in the root of Contiki installation and obviously allows to circumvent the problem with header prefixes.
What keeps my attention - in initial project whole concerned staff (.c, .h) was added into so-called "virtual" folders (of green color) whereas in my new project I added all staff directly. In this last case the folders are of blue color.
Probably here is the key of enigme ?
Regards
Pavel.
Vuki:
Project properties, Compiler search dirs. Put locations of included headers there (relative paths will do). See INCLUDES options in the Makefile for reference.
scarphin:
--- Quote from: Pavel_47 on August 14, 2014, 07:08:13 pm ---Is there some other way to proceed ... i.e. without adding prefixes into header declarations.
--- End quote ---
My humble advice would be continuing using the makefile with CB and adding your extra files to the makefile.
Pavel_47:
I've created source in the project, that uses functions from files already included in project.
In the makefile I replaced older source par new one.
Apparently everything is Ok and new source should be compiled without problem.
But NOT !!! There is still this annoying error ... undefined reference. Here is build log fragment:
--- Code: ---my_udp_client.c(.text.process_thread_udp_client_process+0xae) undefined reference to 'uip_ds6_set_addr_iid'
my_udp_client.c(.text.process_thread_udp_client_process+0xb8) undefined reference to 'uip_ds6_addr_add'
my_udp_client.c(.text.process_thread_udp_client_process+0x1b0) undefined reference to 'uip_ds6_if'
..\..\cpu\cc2538\Makefile.cc2538 70 recipe for target 'my_udp_client.elf' failed
=== Build failed: 4 error(s), 12 warning(s) (0 minute(s), 4 second(s)) ===
--- End code ---
I checked object subfolder - where *.o and *.d filles are stocked. The object file uip-ds6.o (from where originated functions uip_ds6_set_addr_iid and uip_ds6_addr_add) does present in the object subfolder ...
What could signify these errors ? The builder (make.exe) cannot link these object ?
Cordially
Pavel
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version