Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Commpilation fails with "multiple definition of `std::nothrow'" error in ArduinoSTL #10

Open
vishnumaiea opened this issue Jun 30, 2024 · 1 comment

Comments

@vishnumaiea
Copy link
Member

Compiling the example codes for AVR boards fails with the following error.

"C:\\Users\\vishn\\AppData\\Local\\Temp\\arduino\\sketches\\CFD1AAB4CF203E2EAE69AAF90A217759\\libraries\\CSE_ArduinoRS485\\CSE_RS485.cpp.o" "C:\\Users\\vishn\\AppData\\Local\\Temp\\arduino\\sketches\\CFD1AAB4CF203E2EAE69AAF90A217759/..\\..\\cores\\arduino_avr_mega_cpu_atmega2560_f1703447891cbc4ef4897f5c3715b6c9\\core.a" "-LC:\\Users\\vishn\\AppData\\Local\\Temp\\arduino\\sketches\\CFD1AAB4CF203E2EAE69AAF90A217759" -lm
new.cpp.o (symbol from plugin): In function `operator new(unsigned int)':
(.text+0x0): multiple definition of `std::nothrow'
C:\Users\vishn\AppData\Local\Temp\arduino\sketches\CFD1AAB4CF203E2EAE69AAF90A217759\libraries\ArduinoSTL\new_handler.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library CSE_ModbusRTU at version 0.0.7 in folder: D:\Code\Arduino\libraries\CSE_ModbusRTU 
Using library ArduinoSTL at version 1.3.3 in folder: D:\Code\Arduino\libraries\ArduinoSTL 
Using library CSE_ArduinoRS485 at version 1.0.13 in folder: D:\Code\Arduino\libraries\CSE_ArduinoRS485 
Error during build: exit status 1

Used library     Version Path
CSE_ModbusRTU    0.0.7   D:\Code\Arduino\libraries\CSE_ModbusRTU
ArduinoSTL       1.3.3   D:\Code\Arduino\libraries\ArduinoSTL
CSE_ArduinoRS485 1.0.13  D:\Code\Arduino\libraries\CSE_ArduinoRS485

Used platform Version Path
arduino:avr   1.8.6   C:\Users\vishn\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I"
[Error] Verifying sketch 'ModbusRTU_Client_LED.ino': Exit with code=1

Library Version: 0.0.7

@vishnumaiea
Copy link
Member Author

The issue is with the ArduinoSTL library and has been already reported at mike-matera/ArduinoSTL#84. A PR mike-matera/ArduinoSTL#94 already exists but it has not been merged yet.

So the current workaround for those who use the CSE_ModbusRTU library is to manually edit the new_handler.cpp file.

This issue will remain open until the issue is fixed at the ArduinoSTL library side.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant