Code::Blocks
April 19, 2014, 08:51:42 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The new Release 13.12 is out! You can download binaries for windows, mac and many major linux distros from  http://www.codeblocks.org/downloads/26 .
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1] 2 3 4   Go Down
  Send this topic  |  Print  
Author Topic: #include <iostream> NO such File or Directory  (Read 93550 times)
shiguy48
Newcomer
*
Offline Offline

Posts: 3


« on: November 02, 2007, 03:19:03 pm »

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
« Last Edit: November 02, 2007, 03:21:38 pm by shiguy48 » Logged
TDragon
Lives here!
****
Offline Offline

Posts: 917



WWW
« Reply #1 on: November 02, 2007, 03:32:01 pm »

Sounds like your compiler is incorrectly installed; are you using MinGW/GCC?

(Note: Once this problem is fixed, you'll also need a semicolon ";" after using namespace std and an "int" before main(), to successfully compile.)
Logged

http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 4.8.1 2013-10-06 with 32/64-bit, fixed exceptions/DLLs)
killerbot
Administrator
Lives here!
*****
Offline Offline

Posts: 4802


« Reply #2 on: November 02, 2007, 04:01:31 pm »

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.
Logged
gd_on
Regular
***
Offline Offline

Posts: 320


« Reply #3 on: November 02, 2007, 04:37:36 pm »

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
« Last Edit: November 02, 2007, 04:39:27 pm by gd_on » Logged

Windows 7, svn C::B self generated (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.8.1 32 bits version (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 (64 bits) compiled by TDM 4.8.1 in MinGW64
killerbot
Administrator
Lives here!
*****
Offline Offline

Posts: 4802


« Reply #4 on: November 02, 2007, 04:44:47 pm »

forgot the power of remote desktop : on on GCC 3.4.5 system this is OK. So it seems that with GCC 4.2.1 we probably shouldn't add it's internal compiler list (cc plug-in), or something like that ....
Logged
shiguy48
Newcomer
*
Offline Offline

Posts: 3


« Reply #5 on: November 02, 2007, 04:49:57 pm »

yes i am using ming could somebody tell step by step lol what to do im lost when it comes to all this

a wierd thing is it did for a few programs but doesnt work no so if someone can help me i will be
very apprective

thx
« Last Edit: November 03, 2007, 02:30:22 am by shiguy48 » Logged
shiguy48
Newcomer
*
Offline Offline

Posts: 3


« Reply #6 on: November 03, 2007, 07:05:23 pm »

i tryed reinstalling it but i didnt seem to work any more ideas peeps

any more help would be extremely helpful
Logged
Zantetsken
Guest
« Reply #7 on: November 01, 2009, 07:16:12 am »

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.
Logged
stahta01
Lives here!
****
Offline Offline

Posts: 4108


WWW
« Reply #8 on: November 01, 2009, 05:46:59 pm »

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.
Logged

C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ.
TDragon
Lives here!
****
Offline Offline

Posts: 917



WWW
« Reply #9 on: November 03, 2009, 03:50:47 pm »

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.
Logged

http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 4.8.1 2013-10-06 with 32/64-bit, fixed exceptions/DLLs)
Cplusser1
Newcomer
*
Offline Offline

Posts: 3


« Reply #10 on: January 06, 2010, 12:04:10 am »

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?
Logged
stahta01
Lives here!
****
Offline Offline

Posts: 4108


WWW
« Reply #11 on: January 06, 2010, 03:24:45 am »

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.
Logged

C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ.
Cplusser1
Newcomer
*
Offline Offline

Posts: 3


« Reply #12 on: January 06, 2010, 07:20:55 pm »

I have tried that and it didn't work. Sad
Logged
Seronis
Almost regular
**
Offline Offline

Posts: 197



« Reply #13 on: January 08, 2010, 04:12:50 am »

I have tried that and it didn't work. Sad

The 'work' part is when you take the time to copy the full log and paste it here so the experts can see what you did wrong.
Logged
bezerker999
Guest
« Reply #14 on: January 09, 2010, 06:00:33 am »

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
===================================================================
Logged
Pages: [1] 2 3 4   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!