User forums > Using Code::Blocks
iostream: No such file or directory
thomas:
--- Quote from: lxi on October 12, 2005, 05:15:41 pm ---I checked and there was a file called iostream (no extension)
--- End quote ---
That is ok, iostream must not have an extension (that used to be different a couple of years ago).
--- Quote from: lxi on October 12, 2005, 05:15:41 pm ---Compiling: main.cpp
In file included from C:/MinGW/include/windows.h:47,
from main.cpp:1:
--- End quote ---
Here, it would be helpful to change logging to "full commandline" (compiler options, rightmost tab), so you can see what include paths are actually used.
I looked at my windows.h and my stdarg.h, and they are exactly like you described them, so I suspect it has to do with include paths.
Eventually, giving the -print-search-dirs option might help.
--- Quote from: lxi on October 12, 2005, 05:46:33 pm ---I found another (more complete) copy of stdarg.h in C:\MinGW\lib\gcc-lib\mingw32\3.2.3\include, so I added that to the path
--- End quote ---
Not necessary if the install is good. Best never add such obscure paths, when things look stange they're likely wrong. Do I see 3.2.3 in there? You seem to have quite a few versions there.
--- Quote from: lxi on October 12, 2005, 05:46:33 pm ---fails to link with the error: ld: cannot open crt2.o: No such file or directory.
--- End quote ---
C:\mingw\lib has to be in the library path (not only for crt2.o, but for any library you wish to link with), best do that in compiler options rather than in the project options, or you will have to do it again for every new project.
lxi:
--- Quote ---Not necessary if the install is good. Best never add such obscure paths, when things look stange they're likely wrong. Do I see 3.2.3 in there? You seem to have quite a few versions there.
--- End quote ---
I've only got one version installed, which is 3.2.3. My earlier post had 3.4.4 because I was using the version that was included with the Code::Blocks 1.0-RC1 release, and in response to the first reply I uninstalled it (along with MinGW 3.4.4) and did a separate install of Code::Blocks and MinGW (using the MinGW-3.1.0-1.exe installer).
The -print-search-dirs gave me the answer. As it turns out, gcc was still using the include folder for DevkitARM. I couldn't figure out why, but then I checked my environment variables and found one called GCC_EXEC_PREFIX pointing to DevkitARM's install location. I deleted that variable and suddenly everything compiles. :)
Thanks for the fast and detailed replies, I'd been trying to work this out for a couple of weeks on my own and then decided that I should give up and just ask on the forum :)
mandrav:
--- Quote ---I've got a few other IDEs installed; Microsoft Visual Studio .Net 2003, Borland C++ Builder 6 and Delphi 7. I've also got DevkitARM installed which has its own copy of gcc and other tools, but I've removed all references to it from my path so I wouldn't think that it would be causing problems with MinGW.
--- End quote ---
(emphasis added)
See why I asked? :)
Navigation
[0] Message Index
[*] Previous page
Go to full version