LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2011, 02:23 AM   #1
Arvind Das
LQ Newbie
 
Registered: Feb 2011
Location: India
Distribution: Ubuntu
Posts: 1

Rep: Reputation: 0
Lightbulb 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
 
Old 02-13-2011, 02:32 AM   #2
r_s
Member
 
Registered: May 2009
Distribution: slackware, fedora, ubuntu
Posts: 101

Rep: Reputation: 21
This doesn't seem to be a compiler problem, it a problem with your code.
include std namespace using namespace std;
 
Old 02-13-2011, 03:21 AM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

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

#include <iostream>
 
Old 02-13-2011, 04:01 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 02-13-2011, 09:03 AM   #5
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Arvind Das View Post
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.

Last edited by Sergei Steshenko; 02-13-2011 at 09:04 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile application source code on Ubuntu using terminal DirectHit Linux - Newbie 15 09-23-2009 04:21 PM
Strange code in my terminal UltraSoul Solaris / OpenSolaris 5 07-25-2005 12:15 PM
How to open gnome-terminal through code divin Linux - Software 1 03-24-2005 10:01 AM
Terminal Code CyclopsLiteraly Linux - Software 4 06-10-2004 05:04 PM
KDE - Open Terminal Here Code hi_chan Linux - Software 4 03-14-2004 03:12 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration