09-07-2019 10:10 AM
I am trying to compile to BSEC basic for arduino uno platform. I modified the platform.txt as indicated here :https://github.com/BoschSensortec/BSEC-Arduino-library. I created a atmega328p folder in src directory and copied the lib.
now i get the error:
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld: skipping incompatible /Users/skumar/Documents/Arduino/libraries/BSEC-Arduino-library-master/src/atmega328p/libalgobsec.a when searching for -lalgobsec
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld: cannot find -lalgobsec
collect2: error: ld returned 1 exit status
Modified the platform.txt to include compiler.libraries.ldflags.
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{build.path}/{archive_file}" "-L{build.path}" -lm
I am using this on MAC, installed the latest arduino uno (1.8.9).
I understand the library libalgobsec.a is part of the megaAVR family which includes atmega series, which means it should work for atmega328p or uno platform.
Any suggestions on how to fix this?.
Kumar
09-25-2020 11:12 AM
I downloaded this repo today (25.9.2020) and tried to compile basic sketch for ATmega2560 but got the similar (incompatible) error:
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: skipping incompatible C:\Users\arduinouser\Documents\Arduino\libraries\BSEC\src\atmega2560\libalgobsec.a when searching for -lalgobsec
A few more lines before error appeared:
Compiling sketch...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\mega" "-IC:\\Users\\arduinouser\\Documents\\Arduino\\libraries\\BSEC\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\Wire\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258\\sketch\\basic.ino.cpp" -o "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258\\sketch\\basic.ino.cpp.o"
Compiling libraries...
Compiling library "BSEC"
Library BSEC has been declared precompiled:
Using precompiled library in C:\Users\arduinouser\Documents\Arduino\libraries\BSEC\src\atmega2560
Using previously compiled file: C:\Users\arduinouser\AppData\Local\Temp\arduino_build_965258\libraries\BSEC\bsec.cpp.o
Using previously compiled file: C:\Users\arduinouser\AppData\Local\Temp\arduino_build_965258\libraries\BSEC\bme680\bme680.c.o
Using previously compiled file: C:\Users\arduinouser\AppData\Local\Temp\arduino_build_965258\libraries\BSEC\BSEC.a
Compiling library "Wire"
Using previously compiled file: C:\Users\arduinouser\AppData\Local\Temp\arduino_build_965258\libraries\Wire\Wire.cpp.o
Using previously compiled file: C:\Users\arduinouser\AppData\Local\Temp\arduino_build_965258\libraries\Wire\utility\twi.c.o
Compiling library "SPI"
Using previously compiled file: C:\Users\arduinouser\AppData\Local\Temp\arduino_build_965258\libraries\SPI\SPI.cpp.o
Compiling core...
Using precompiled core: C:\Users\arduinouser\AppData\Local\Temp\arduino_cache_256396\core\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a
Linking everything together...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -Wl,-Map "-Wl,C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258/basic.ino.map" -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -o "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258/basic.ino.elf" -Wl,--start-group "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258\\sketch\\basic.ino.cpp.o" "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258\\libraries\\BSEC\\BSEC.a" "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258\\libraries\\Wire\\Wire.cpp.o" "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258\\libraries\\Wire\\utility\\twi.c.o" "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_cache_256396\\core\\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\\Users\\arduinouser\\Documents\\Arduino\\libraries\\BSEC\\src\\atmega2560" -lalgobsec -lalgobsec -Wl,--end-group "-LC:\\Users\\arduinouser\\AppData\\Local\\Temp\\arduino_build_965258"
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: skipping incompatible C:\Users\arduinouser\Documents\Arduino\libraries\BSEC\src\atmega2560\libalgobsec.a when searching for -lalgobsec
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: cannot find -lalgobsec
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: skipping incompatible C:\Users\arduinouser\Documents\Arduino\libraries\BSEC\src\atmega2560\libalgobsec.a when searching for -lalgobsec
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: cannot find -lalgobsec
collect2.exe: error: ld returned 1 exit status
Using library BSEC at version 1.5.1474 in folder: C:\Users\arduinouser\Documents\Arduino\libraries\BSEC
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
exit status 1
Error compiling for board Arduino Mega or Mega 2560.