Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

<iostream> not found when compiling project #176

Open
anna-seppala opened this issue Jul 13, 2017 · 1 comment
Open

<iostream> not found when compiling project #176

anna-seppala opened this issue Jul 13, 2017 · 1 comment

Comments

@anna-seppala
Copy link

Hello all,
I recently stumbled upon this project when looking for ways to use cmake with Arduino. I am reusing the examples within the project, and wanted to expand blink.cpp by using . Only adding the include into blink.cpp makes the compilation fail. cmake is unable to find the library and terminates compilation. I fail to understand why. Could anyone enlighten me?

@JonasProgrammer
Copy link

Hello Anna,
you seem to misunderstand what Arduino CMake actually is and what it isn't. Let me explain: Arduino CMake is just a build system to give you more freedom in structure and options especially for bigger projects. But it still uses the very same compiler and libraries Arduino itself provides (avr-gcc and the default Arduino libraries).
So while you can compile and link additional libraries with CMake, it still does not provide fully-fledged C++ standard library (which iostream belongs to*).

To answer your question, if you want to interact with a user, you could just use the Serial library and connect to the virtual serial terminal on PC. Please do note however, that this is by far simpler than the C++ stream libraries.

Although it's been 2 months, I hope I still could help a little.

  • This is oversimplified. The C++ standard defines freestanding and hosted environments (neither of which Arduino fully provides) and the stream libraries belong to the latter, thus you shouldn't expect them to be available in most lowlevel compiler toolchains.

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

No branches or pull requests

2 participants