Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Help with building a program

Hello,

 

I am attempting to build a simple program:

 

/*

* HelloWorld.cpp

*

*  Created on: Jul 7, 2014

*      Author: rklein

*/

 

#include <iostream>

 

 

int main() {

                using namespace std;

                cout << "Hello World!" << endl;

                return 0;

}

 

And receive the following errors:

 

**** Build of configuration Debug for project FirstProject ****

 

**** Internal Builder is used for build               ****

g++ -O0 -g3 -Wall -c -fmessage-length=0 -oHelloWorld.o ../HelloWorld.cpp

../HelloWorld.cpp: In function ¡int main()¢:

../HelloWorld.cpp:11: error: ‘cout’ was not declared in this scope

../HelloWorld.cpp:11: error: ‘endl’ was not declared in this scope

Build error occurred, build is stopped

Time consumed: 165  ms. 

 

This should work. It is the example program in your help documentation.

 

In the Project Explorer I see:

->FirstProject

  ->includes

     ->/usr/include

    ->/usr/include/c++/4.4.4

 

And other include files as well.

But in the /usr/include/4.4.4, there is a iostream header file so do not understand why I am seeing this problem.

 

Thanks,

Rodney Klein

Fermilab

PO Box 500

Batavia, Ill. 60510

 


Back to the top