LinuxQuestions.org
Review your favorite Linux distribution.
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 09-13-2008, 01:27 AM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Rep: Reputation: 30
compile cpp code including iostream


I download some cpp codes out of the Internet.
It include iostream, cstring.. instead of stdio.h that i am more familiar with.

I got an error compiling it with

$ gcc myfile.cpp or $gcc myfile.c

It complain about cannot find iostream etc.

Is there special flag I need to include in the gcc command?
 
Old 09-13-2008, 01:30 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You should really use g++ to compile C++ code. Edit: it is possible to use gcc (although perhaps not in all cases), if you link the C++ standard libary (i.e. -lstdc++).

Last edited by Nylex; 09-13-2008 at 01:34 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Linux iostream vs Windows iostream davidguygc Programming 2 05-13-2007 09:13 PM
Including the header file of a module in kernel code omkarlagu Linux - Newbie 0 02-05-2006 07:55 AM
How do I compile a *.cpp Document in linux? njbrain Linux - Software 9 01-29-2004 07:43 PM
compile programs in c and cpp Manjula.S Linux - Software 2 10-15-2003 01:06 AM
c++ code how to compile and iostream.h saavik Programming 5 09-03-2002 08:30 AM

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

All times are GMT -5. The time now is 08: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