Below is the error that I get when I try to build my project. I am unsure what file or directory it is talking about. All the files and directories are within the project directory.
I followed the instructions in http://arduino.cc/playground/Code/Eclipse to set up my IDE.
Should the Arduino core files be within the project directory and specifically added to the Arduino core library? All I gave it was the liArduinoCore.a file that was produced by my Arduino IDE. Could this be the issue?
The error message
**** Build of configuration Debug for project CustomLEDPoi ****
make all
Building target: CustomLEDPoi.elf
Invoking: AVR C++ Linker
avr-gcc -Wl,-Map,CustomLEDPoi.map,--cref Wl,--gc-sections - L"C:\Users\Justin\workspaceArduino\arduino_core\src" -L"C:\Users\Justin\workspaceArduino\arduino_core\328P_16MHz Arduino\src" -L"C:\Users\Justin\workspaceArduino\CustomLEDPoi\arduinolib" -L"C:\Users\Justin\workspaceArduino\CustomLEDPoi\lib" -mmcu=atmega328p -o "CustomLEDPoi.elf" ./src/glowstick2.o ./lib/CShiftPWM.o ./lib/MeetAndroid.o ./lib/hsv2rgb.o ./arduinolib/HardwareSerial.o ./arduinolib/SPI.o -lArduinoCore
avr-gcc.exe: Wl,--gc-sections: No such file or directory
make: *** [CustomLEDPoi.elf] Error 1
**** Build Finished ****
It seems that a - is missing for Wl,--gc-sections. It should actually be -Wl,--gc-sections. Without the proper flag, the compiler assumes that it's a source file. You should check the makefile and verify.
Related
Im not entirely sure if iv misunderstood the instructions on https://os.mbed.com/docs/mbed-os/v5.12/tutorials/eclipse.html
where it states
make[1]: arm-none-eabi-g++: No such file or directory, you need to configure Eclipse's PATH (not your OS PATH).
can someone please clarify what i need to do or if im missing something.
To me this is just asking to go to CMD, where gcc ect -> and paste the location into the PATH under enviroment. i still get the error.
-pasted in the location of where arm-none-eabi-g++ in my PATH
-added C:/cygwin64/bin into my path
installed every single thing under the sun when it comes to mingw/ or anything else remotely connected
01:09:44 **** Incremental Build of configuration Default for project Nucleo_blink_color_led ****
make all
Compile: main.cpp
make[1]: arm-none-eabi-g++: Command not found
make[1]: *** [main.o] Error 127
make: *** [all] Error 2
I have converted a static library project and an exe project to Scons project in ECLIPSE. These were building fine by Makefile.
But when I am building the static library project it gives an error as below -
=== Running SCons at 18/11/13 8:55 PM ====
Command line: /usr/bin/scons -u --jobs=8
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: Debug
o Debug/add.o -c add.cpp
sh: o: not found
ar rc Debug/libadd.a Debug/add.o
ar: Debug/add.o: No such file or directory
scons: *** [Debug/libadd.a] Error 1
scons: building terminated because of errors.
Duration 301 ms.
1) my main objective is to a trigger a build once somehow (in the exe project) and both the project will be compiled in ECLIPSE. Is there a way to see and edit a SConscript in eclipse.
2) How do I do it? By manually writing SConscript and SConstruct file? :(
It looks from the SCons output like SCons can't find the compiler on your system. What OS are you using? And what version of SCons? (Type scons --version to see that.)
So I am compiling for MIPS architecture on a Linux 386 host in eclipse CDT. I have a project that is supposed to give me a library I can use on another project.
Compiling of that project works just fine. I end up with a libMyProject file.
So in my second project I reference the library file with the -L option for the path and the -l option for the library. All names are correct, however I end up with a Linker error (file not found).
Thats invoking the linker:
mips-openwrt-linux-g++ -L"/home/user/workspace/MyProject/DebugLibrary" -o "MySecondProject" ./HelloWorld.o -lMyProject
And thats the error I get in eclipse:
/home/user/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lMyProject
collect2: ld returned 1 exit status
Any suggestions?
Ok I found it.
Had to append the extension .a to the library in the command line pattern of the linker:
${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}.a ${INPUTS}
I am trying to compile a project but I'm getting an error right away that it's not seeing the header files that are in some packages inside the project. Here is a picture, notice that it is not finding the AwarenessMoment.h file, however it is in there.
Here is the output:
**** Build of configuration Debug for project RoyOS ****
make all
Building file: ../src/royos/vision/ImageRecognizer.cpp
Invoking: GCC C++ Compiler
g++ -I/home/igvc/Documents/teamigvc/trunk/RoyOS -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/royos/vision/ImageRecognizer.d" -MT"src/royos/vision/ImageRecognizer.d" -o"src/royos/vision/ImageRecognizer.o" "../src/royos/vision/ImageRecognizer.cpp"
In file included from ../src/royos/vision/ImageRecognizer.cpp:8:0:
../src/royos/vision/ImageRecognizer.h:11:29: fatal error: AwarenessMoment.h: No such file or directory
compilation terminated.
make: *** [src/royos/vision/ImageRecognizer.o] Error 1
Anyone know why it's not seeing these header files?
Thanks
There's definitely something wrong with the include path given to the compiler. The preprocessor can't find the header from the source file you are attempting to compile.
I think you could fix this by replacing
#include "AwarenessMoment.h"
with
#include "../sensor/AwarenessMoment.h"
Either that or alter the compiler include path to include the sensor directory and use:
#include <AwarenessMoment>
The console output is:
**** Build of configuration Release for project Timertestnew ****
make all
Building file: ../main.cpp
Invoking: AVR C++ Compiler
avr-g++ -I"G:\arduino-1.0\hardware\arduino\cores\arduino" -DARDUINO=100 -Wall -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -fno-exceptions -mmcu=atmega328p -DF_CPU=16000000UL -MMD -MP -MF"main.d" -MT"main.d" -c -o "main.o" "../main.cpp"
Finished building: ../main.cpp
Building target: Timertestnew.elf
Invoking: AVR C++ Linker
avr-gcc --cref -s -Os -o"Timertestnew.elf" ./main.o -lArduinoCore -lm -Wl,-Map,Timertestnew.map,--cref -L"C:\Users\Akhil\workspace\Timertestnew" -mmcu=atmega328p
Finished building target: Timertestnew.elf
Create Flash image (ihex format)
avr-objcopy -R .eeprom -O ihex Timertestnew.elf "Timertestnew.hex"
Finished building: Timertestnew.hex
Invoking: Print Size
avr-size --format=avr --mcu=atmega328p Timertestnew.elf
AVR Memory Usage
----------------
Device: atmega328p
Program: 620 bytes (1.9% Full)
(.text + .data + .bootloader)
Data: 9 bytes (0.4% Full)
(.data + .bss + .noinit)
Finished building: sizedummy
**** Build Finished ****
The 'Problem' view output is:
Description Resource Path Location Type
Symbol 'EEARH' could not be resolved main.cpp /Timertestnew line 15 Semantic Error
Is it possible that eclipse ide is mistakenly showing this error while it compiles it fine?
How can I fix this?
Try to delete that problem marker from the problems view and rebuild your project (entirely, not just an incremental). If that fixes the issue, than it was simply an inconsistent state of the compiler.
However, if it does not fix the problem, then it is possible that the Eclipse editor uses a different parser (for content assist, etc.), that cannot handle something your compiler can. For this case, I would look around the C/C++ editor preferences related to errors, maybe it is turnable off (however, I don't program C/C++, so I cannot tell you what to look for).
The avr-gcc compiler uses its -mmcu command line argument to determine which IO header file to include (and therefore symbolic register definition including the EEARH EEPROM high address register being reported). Documentation here.
Eclipse may not be aware of this 'backdoor' preprocessor symbol definition (as it probably is using a different compiler for problem detection). From the console output it looks like the IO header file you need is: avr/iom328p.h which is included when the __AVR_ATmega328P__ preprocessor symbol is defined (see here). If you provide this symbol to Eclipse it should cause its compiler to pick up the correct file and define the relevant registers.