C ++; Eclipse linker error

So while working on how my Eclipse IDE will work, I can develop my arduino uno in eclipse. My C ++ is weak, so this is probably a nube bug on my part.

I have a blink program that is looking for the arduino library which I have compiled from the arduino IDE library. My code is pointing to the header file and my code is finding it ok; what can I push to:

#include <arduino.h>

      

and go to header view

this: "C: /programs/arduino-1.0/hardware/arduino/cores/328p_lib/libuno_library.a" is a valid path ... but I get the following error:

>****** Build of configuration Debug for project project1 ****
>make all 
>Building target: project1.elf
>Invoking: AVR C++ Linker
>avr-g++ -Wl,-Map,project1.map,--cref -L"C:\programs\arduino->1.0\hardware\arduino\cores\328p_lib" -mmcu=atmega328p -o "project1.elf"  ./code/code1.o   >-l"C:/programs/arduino-1.0/hardware/arduino/cores/328p_lib/libuno_library.a"
>c:/programs/winavr/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: cannot find ->lC:/programs/arduino-1.0/hardware/arduino/cores/328p_lib/libuno_library.a
>make: *** [project1.elf] Error 1
>**** Build Finished ******

      

+3


source to share


2 answers


Ok after spending 2 days or so fun time I finally found the problem.

http://sourceforge.net/projects/avr-eclipse/forums/forum/664382/topic/4640554



When adding a static library to the linker, you need to remove the lib prefix and the .a suffix. not sure what that means.

+2


source


Right click on the project> Click on C / C ++ BUild> Preferences> GCC C ++ Linker> Libraries

Click the first Add icon> Add Library Name (no .a suffix, suffix will be added automatically)

This will ensure that the library is added to the project.



If the library is part of another project> Go to GCC C Compiler> directory> Add directory

This will ensure that there is a library to get the compilation.

+2


source







All Articles