CompilerError undefined reference SAMD51

Hey all
I get a errormessage when i try to compile arduino_state_machine (Example from https://github.com/jrullan/StateMachine StateMachine Library, which needs GitHub - ivanseidel/LinkedList: πŸ”— A fully implemented LinkedList made to work with general Microcontrollers and Arduino projects LinkedList Library) for a Sparkfun SAMD51 Micromod.

Arduino: 1.8.15 (Mac OS X), Board: "SparkFun SAMD51 MicroMod"

libraries/LinkedList/tests.cpp.o: In function `main':
/Users/-/Documents/Arduino/libraries/LinkedList/tests.cpp:332: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
libraries/LinkedList/tests.cpp.o: In function `std::ostream::operator<<(std::ostream& (*)(std::ostream&))':
/Users/-/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/arm-none-eabi/include/c++/4.8.3/ostream:113: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
libraries/LinkedList/tests.cpp.o: In function `main':
/Users/-/Documents/Arduino/libraries/LinkedList/tests.cpp:333: undefined reference to `std::cout'
libraries/LinkedList/tests.cpp.o: In function `__static_initialization_and_destruction_0':
/Users/-/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/arm-none-eabi/include/c++/4.8.3/iostream:74: undefined reference to `std::ios_base::Init::Init()'
/Users/-/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/arm-none-eabi/include/c++/4.8.3/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit status
exit status 1
Fehler beim Kompilieren fΓΌr das Board SparkFun SAMD51 MicroMod.

In the explanation it says that tests.cpp can be run from the command line of your operating system. The file tests.cpp is not for Arduino.

Hi Luca,

welcome to the arduino-Forum. Well done posting the error-messages as a code-section.

The compiler says

/Library/Arduino15/packages/arduino/

I haven't used SMAD51 boards. But I guess this line should show something like
/Library/Arduino15/packages/SAMD/ instead of "arduino"

Did you install the board-package for SAMD51-boards?
Did you add the additional Board-URL in the preferences?

best regards Stefan

It is very unfortunate that the maintainer of the LinkedList library allowed this to be introduced into their library in this way. I guess they didn't bother to do the most basic test of hitting the "Compile" button before accepting it.

There is a contributed fix, but it hasn't been accepted yet:

The workaround is to delete this file from your computer:

/Users/-/Documents/Arduino/libraries/LinkedList/tests.cpp

:warning: Please be very careful when deleting things from your computer. When in doubt, back up!

As Koepel already explained, the file is only used for testing of the library during development, so deleting it will not cause any problems for people who only want to use the library with their Arduino projects.

1 Like

Should be fixed guys. I just updated the code, and released a new version (1.3.3). Not shure how long Arduino takes to refresh the libraries repositories... but shouldnt take so long

3 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.