ivanseidel / LinkedList

🔗 A fully implemented LinkedList made to work with general Microcontrollers and Arduino projects
MIT License
347 stars 120 forks source link

iostream compilation error on Arduino Mega #39

Closed Luana-Menezes closed 2 years ago

Luana-Menezes commented 4 years ago
/home/luana/Arduino/libraries/LinkedList/tests.cpp:5:10: fatal error: iostream: No such file or directory
 #include <iostream>
          ^~~~~~~~~~
compilation terminated.
exit status 1

Error compiling for Arduino Mega or Mega 2560 board. It just works removing this file.

morrocoyo08 commented 4 years ago

Idem com Uno IDE 1.8.13

mccartes commented 3 years ago

It looks like Iostream is not supported in arduino:

in the linked list library it fails to compile on arduino because the linked list library includes the following in the "tests.cpp" file:

include

std::cout<< "Tests pass"<< std::endl;

when I comment out these two lines, then the whole thing compiles successfully However this test.cpp also breaks the serial monitor.

singhangadin commented 3 years ago

Deleted test.cpp, it fixed the issue. Problem solved.

GregJohnStewart commented 3 years ago

Deleted test.cpp, it fixed the issue. Problem solved.

Confirmed, worked for me as well. Fairly annoying for someone trying to use the lib with Arduino, but at least it's not a complex fix. Looks to me that the Arduino IDE is being overzealous and just compiling everything in a library's source directory. I wonder if there is a way to get around that?