header and source files? [message #689790] |
Tue, 28 June 2011 07:19  |
Eclipse User |
|
|
|
Hello, great CDT gurus.
I humbly come here requesting help with a problem I´ve been having and having scanned through the forums havent found a solution to yet (or maybe I am too dense to spot it).
Let us consider the following scenario.
I have foo.h and foo.c files. foo.h contains the prototype for "void HungFoo(int n);" and its code is in the .c file. Now I include foo.h in my main.cpp file and try to use the HungFoo function. When I build the project I am greeted with a "undefined reference to 'HungFoo'" error. Is there a fix to this? Or does eclipse just not support indirect referencing like this between a .h and .c (or .cpp) file?
I used this quite a lot in visual c++ which makes me wonder if this is a missing functionality or if I missed a step somewhere?
|
|
|
|
|
Re: header and source files? [message #690903 is a reply to message #690897] |
Thu, 30 June 2011 07:58   |
Eclipse User |
|
|
|
Tought it might be useful adding the actual compiler/linker output from my current project, obviously its not a foo.something type project :
Quote:
Building target: FunkOS_Test.elf
Invoking: AVR C++ Linker
avr-gcc --cref -s -Os -o "FunkOS_Test.elf" ./driver.o ./heap.o ./kernelswi.o ./kerneltimer.o ./kernelwdt.o ./main.o ./message.o ./mutex.o ./semaphore.o ./task.o ./taskport.o ./timer.o ./watchdog.o -lArduinoCore -lm -Wl,-Map,FunkOS_Test.map,--cref -L"C:\Users\kristinnes\workspace\ArduinoCore\Release" -mmcu=atmega328p
./main.o: In function `MyTask(MY_TASK_STRUCT*)':
../main.cpp:85: undefined reference to `Task_Sleep(unsigned short)'
./main.o: In function `main':
../main.cpp:44: undefined reference to `Task_Init()'
../main.cpp:52: undefined reference to `Task_CreateTask(Task_Struct*, char*, unsigned char*, unsigned short, unsigned char, void (*)(void*))'
../main.cpp:60: undefined reference to `Task_CreateTask(Task_Struct*, char*, unsigned char*, unsigned short, unsigned char, void (*)(void*))'
../main.cpp:62: undefined reference to `Task_Add(Task_Struct*)'
../main.cpp:63: undefined reference to `Task_Add(Task_Struct*)'
../main.cpp:65: undefined reference to `Task_Start(Task_Struct*)'
../main.cpp:66: undefined reference to `Task_Start(Task_Struct*)'
../main.cpp:68: undefined reference to `Task_StartTasks()'
make: *** [FunkOS_Test.elf] Error 1
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07562 seconds