Page 1 of 1

iostream, string, sstring won't include

Posted: Sun Mar 27, 2011 4:40 am
by Stephen
I'm not sure if devkitPro is supposed to have these (iostream, string, sstring) included with the install. I asked several people in the GRRLIB irc and some of them said it should work and some said that these aren't included.

When I try #include <iostream>, string, or string, it says couldn't find the file:

Code: Select all

fatal error: iostream: No such file or directory
Are these files supposed to come with devkitPro or am I supposed to get them from somewhere else and link them in somehow?

P.S. I'm really sorry if this is in the wrong section, I didn't see a general devkitPro help section.

Re: iostream, string, sstring won't include

Posted: Sun Mar 27, 2011 2:53 pm
by WinterMute
There's no general devkitPro help section because devkitPro is a toolchain vendor, we produce several toolsets - devkitARM, devkitPSP and devkitPPC. What you're using is devkitPPC (and I only know that because you mentioned GRRLIB).

The compiler can't find these includes because you're compiling C code.

Clean your project, rename your source files from .c to .cpp and recompile.

Re: iostream, string, sstring won't include

Posted: Mon Mar 28, 2011 4:12 pm
by Izhido
Just to clarify a little on what WinterMute said: The current toolchain(s), with the default makefiles, ask specifically for C++ code to be inside a file with a .cpp extension, while C code must be in a file with a .c extension. Header files are not restricted to a specific extension name, though.

We're aware some compilers/IDEs/toolchains do not demand such an arrangement, but these ones do.

Hope that helps.

Re: iostream, string, sstring won't include

Posted: Wed Apr 06, 2011 8:46 pm
by Stephen
Ah i see! Thanks! That helps a LOT!