LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Can not compile C++ code in terminal !!!! (https://www.linuxquestions.org/questions/programming-9/can-not-compile-c-code-in-terminal-862364/)

Arvind Das 02-13-2011 02:23 AM

Can not compile C++ code in terminal !!!!
 
I am unable to compile C++ program in terminal. Whenever I try to add "#include<iostream.h>" it shows an error and thats why I can not use "cout" and "cin" functions.
I installed g++ for this but the problem persists. Help me out
Thanks

r_s 02-13-2011 02:32 AM

This doesn't seem to be a compiler problem, it a problem with your code.
include std namespace using namespace std;

Nylex 02-13-2011 03:21 AM

Also, you probably want to drop the ".h", so the include directive is just

#include <iostream>

colucix 02-13-2011 04:01 AM

Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.

Sergei Steshenko 02-13-2011 09:03 AM

Quote:

Originally Posted by Arvind Das (Post 4256723)
I am unable to compile C++ program in terminal. Whenever I try to add "#include<iostream.h>" it shows an error and thats why I can not use "cout" and "cin" functions.
I installed g++ for this but the problem persists. Help me out
Thanks

You have to:
  1. show your whole code;
  2. show the exact command line;
  3. show the exact error message(s).

Typically you do this by:

Code:

cat -n SOURCE_FILE
g++ ...

and copy-pasting screen output of the above.


All times are GMT -5. The time now is 02:53 PM.