添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
hello there i am new to c++

i have tryed to compile this program but it says


#include <iostream> NO such File or Directory

was just wondering y as some of my programs work right but some do this

#include <iostream>
using namespace std

main()
{
cout << "hello there Does this program work"  << endl;
cout << "check it a new line"  << endl;
return(0);
}

any help would be apprecated greatly thx
just checked this with MinGW GCC4.2.1, works ok, with the side effect that the the file is found twice !!!
Once in : c:\MinGW\lib\gcc\mingw32\4.2.1-dw2\include\c++\iostream
and once in  C:\MinGW\lib\gcc\mingw32\4.2.1-dw2\include\c++\iostream

note the difference : c <---> C:

This is something we didn't have with MinGW GCC 3.4.5, or it should be a very recent regression; Can anyone check this with the latest svn on MinGW3.4.5 ? The earliest I can get hold of a MinGW GCC 3.4.5 system is on monday.
I tried this program with gcc 3.4.5 after corrections suggested by Tdragon. (C::B 4564, windows XP, SP2)
Activating all warning and strict iso checking... full message display...
But all is working well, no problem at compilation or link time. No double definition. But may be I forgot to activate something !

gd_on
Sorry to bump an ancient topic, but it was at the top of the list on Google when I searched iostream codeblocks . I was having the same problem and hoped to find a solution, but there was none to be found. All your "MinGW" and "GCC" just confused the hell out of me since I'm completely new to C++ and have no idea what anything is.


The solution is to put your .c file in the same folder you have Code::Blocks installed in. I originally had test.c on my desktop and got the same error shiguy48 did, but it worked perfectly fine when I moved it to C:\Program Files\CodeBlocks and tried it from there.
Sorry to bump an ancient topic, but it was at the top of the list on Google when I searched iostream codeblocks . I was having the same problem and hoped to find a solution, but there was none to be found. All your "MinGW" and "GCC" just confused the hell out of me since I'm completely new to C++ and have no idea what anything is.


The solution is to put your .c file in the same folder you have Code::Blocks installed in. I originally had test.c on my desktop and got the same error shiguy48 did, but it worked perfectly fine when I moved it to C:\Program Files\CodeBlocks and tried it from there.

FYI:

C++ files are required to have the extension .cpp when using Code::Blocks.

Tim S.
All your "MinGW" and "GCC" just confused the hell out of me since I'm completely new to C++ and have no idea what anything is.
A word of advice, then -- RTFM. Read everything, in fact, because right on the Code::Blocks download page it says:

Quote
NOTE: The codeblocks-8.02mingw-setup.exe file includes the GCC compiler and GDB debugger from MinGW.

That makes it fairly clear.
I am having the same issue but I downloaded from the codeblocks-8.02mingw-setup.exe and have double-checked all of my settings but cannot find any reason why iostream cannot be found. Any help?

Turn on full compiler logging
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.
I am having the same problem with "iostream" and I moved my "test.c" to C:/Program Files/codeblocks and it worked.
Two questions:
1. Why?
2. What do I have to do to compile *.c in other directories

Global Settings:
GNU GCC Complier
Toolchain ex
instal dir = C:\Program Files\CodeBlocks\MinGW
no make.exe in bin directory but found a mingw32-make.exe

Windows 2000 Pro
Dell Latitudue Laptop
===================================================================