Novice User Error: Fatal Error <iostream> No Such File

General questions regarding the usage of CodeLite
NicolGroup
CodeLite Curious
Posts: 4
Joined: Tue Feb 17, 2015 5:38 pm
Genuine User: Yes
IDE Question: C++
Contact:

Novice User Error: Fatal Error <iostream> No Such File

Post by NicolGroup »

Can't get a simple C++ program to compile. I suspect other new users might have the same issues.

I have downloaded MinGW from their site and installed in a separate C:\MinGW directory. I suspect that I need to update various Settings. Is there any documentation on updating the Setting with advice on how to get a trivial program working. If not, what are my next steps.

I located an "iostream" file deep down in the following directory structure: c:\MinGW\mingw32\Lib\gcc\mingw32\4.8.1\include\C++.

Thanks for your help and patience.
------------------------------------------------------------------------------------------------------------------------------------

Code: Select all

#include <iostream>
using namespace std;

int main(void)
{
        cout << "Hello World" << endl;
}                      
-----------------------------------------------------------------------------------------------------------------------------------

Error Messages [since this was clipped out of screen capture there may be typos]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C:\WINDOWS\system32\cmd.exe /C “C:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile 
Building project:[ Arrays - Debug ]
C:/MinGW/bin/g++.exe -c “C:/Users/User/LearnProg/SecondWork!Arrays/main.cpp” -g -00 -Wall -o ./Debug/main.cpp.o -I. -I. C:/Users/User/LearnProg/SecondWork/Arrays/main.cpp:1:20: fatal error: iostream: No such file or directory 
#include <iostream> 
A 
compilation terminated. 
mingw32-make.exe[1]: [Debug/,main.cpp.o] Error 1 
mingw32-make.exe: [All] Error 2 
Arrays.mk:93: recipe for target Debug/main.cpp.o failed 
Makefile:4: recipe for target A11 failed 
I Build Ended with Errors]: 2 errors, 0 warnings 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

You should not set anything special, the compiler should be able to know where to search for the default headers (such as "iostream")
I strongly recommed you to use the TDM seriese of MinGW

If you want to use the 64 bit version, download this:
http://sourceforge.net/projects/tdm-gcc ... e/download

For the 32 bit version of MinGW, install this:
http://sourceforge.net/projects/tdm-gcc ... e/download

I personally use the 64 bit version.
To install it:
  • download the installer
  • follow the instructions
Please accept the defaults and do not install MinGW under a path with spaces, the default C:\TDM-GCC-64 (or 32) is good - accept it.

Once the installation is completed, tell codelite about the new compiler:
Settings->Build Settings->Compilers->Add compilers button->Scan computer for installed compilers

CodeLite should be able to locate the compiler. If it does not detect for some reason, add it like this:
Settings->Build Settings->Compilers->Add compilers button->add an exsiting compiler
and point codelite to the installation folder (e.g. C:\TDM-GCC-64 or to C:\TDM-GCC-64\bin )

Open your project settings->common settings->general->compiler type
and select the new compiler, rebuild your project and it should work

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

You should not set anything special, the compiler should be able to know where to search for the default headers (such as "iostream")
I strongly recommed you to use the TDM seriese of MinGW

If you want to use the 64 bit version, download this:
http://sourceforge.net/projects/tdm-gcc ... e/download

For the 32 bit version of MinGW, install this:
http://sourceforge.net/projects/tdm-gcc ... e/download

I personally use the 64 bit version.
To install it:
  • download the installer
  • follow the instructions
Please accept the defaults and do not install MinGW under a path with spaces, the default C:\TDM-GCC-64 (or 32) is good - accept it.

Once the installation is completed, tell codelite about the new compiler:
Settings->Build Settings->Compilers->Add compilers button->Scan computer for installed compilers

CodeLite should be able to locate the compiler. If it does not detect for some reason, add it like this:
Settings->Build Settings->Compilers->Add compilers button->add an exsiting compiler
and point codelite to the installation folder (e.g. C:\TDM-GCC-64 or to C:\TDM-GCC-64\bin )

Open your project settings->common settings->general->compiler type
and select the new compiler, rebuild your project and it should work

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

It looks like a compiler problem as your compiler should locate these files without changing anything within codelite.
I strongly recommend you to install a different compiler, to name one: TDM GCC.
http://sourceforge.net/projects/tdm-gcc ... e/download
Install it and let codelite know about it:
* settings->build settings->compilers->add a compiler button->scan computer for installed compilers
* if the above did not find it, "help" codelite a bit: settings->build settings->compilers->add a compiler button->add an existing compiler and then select the folder where you installed the compiler
* Change the compiler in your project settings (Alt-F7) to use the new one: project settings->common settings->general->compiler type
* Rebuild your project

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

It looks like a compiler problem as your compiler should locate these files without changing anything within codelite.
I strongly recommend you to install a different compiler, to name one: TDM GCC.
http://sourceforge.net/projects/tdm-gcc ... e/download
Install it and let codelite know about it:
* settings->build settings->compilers->add a compiler button->scan computer for installed compilers
* if the above did not find it, "help" codelite a bit: settings->build settings->compilers->add a compiler button->add an existing compiler and then select the folder where you installed the compiler
* Change the compiler in your project settings (Alt-F7) to use the new one: project settings->common settings->general->compiler type
* Rebuild your project

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

It looks like a compiler problem as your compiler should locate these files without changing anything within codelite.
I strongly recommend you to install a different compiler, to name one: TDM GCC.
http://sourceforge.net/projects/tdm-gcc ... e/download
Install it and let codelite know about it:
* settings->build settings->compilers->add a compiler button->scan computer for installed compilers
* if the above did not find it, "help" codelite a bit: settings->build settings->compilers->add a compiler button->add an existing compiler and then select the folder where you installed the compiler
* Change the compiler in your project settings (Alt-F7) to use the new one: project settings->common settings->general->compiler type
* Rebuild your project

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

It looks like a compiler problem as your compiler should locate these files without changing anything within codelite.
I strongly recommend you to install a different compiler, to name one: TDM GCC.
http://sourceforge.net/projects/tdm-gcc ... e/download
Install it and let codelite know about it:
* settings->build settings->compilers->add a compiler button->scan computer for installed compilers
* if the above did not find it, "help" codelite a bit: settings->build settings->compilers->add a compiler button->add an existing compiler and then select the folder where you installed the compiler
* Change the compiler in your project settings (Alt-F7) to use the new one: project settings->common settings->general->compiler type
* Rebuild your project

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

It looks like a compiler problem as your compiler should locate these files without changing anything within codelite.
I strongly recommend you to install a different compiler, to name one: TDM GCC.
http://sourceforge.net/projects/tdm-gcc ... e/download
Install it and let codelite know about it:
* settings->build settings->compilers->add a compiler button->scan computer for installed compilers
* if the above did not find it, "help" codelite a bit: settings->build settings->compilers->add a compiler button->add an existing compiler and then select the folder where you installed the compiler
* Change the compiler in your project settings (Alt-F7) to use the new one: project settings->common settings->general->compiler type
* Rebuild your project

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Novice User Error: Fatal Error <iostream> No Such File

Post by eranif »

sorry about this spam, looks like there was a problem in the forum

Eran
Make sure you have read the HOW TO POST thread
Post Reply