Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   How to compile C++ code in GNU/Linux OS ? (http://www.programmingforums.org/showthread.php?t=8563)

verb1426 Feb 24th, 2006 11:58 AM

How to compile C++ code in GNU/Linux OS ?
 
Hi guys

I have always heard about GNU/Linux operating system and its advantages.So I reacently installed it.The problem is with compiling the c++ code using the command prompet.I am new to this OS and I have read that if I want to compile c++ code,I should save it in C file format and then browse to it through the shell ( or whatever its name is) then type:

gcc ****.c (**** indicate the file name)

but I keep receiving a maessage stating that the file was not found ,although I am 100% sure that it there (using dir command)

What is the problem?

Thank you all....
Verb1426

Kaja Fumei Feb 24th, 2006 12:04 PM

Read this: http://www.cs.wm.edu/cspages/computi...orial/gpp.html

verb1426 Feb 24th, 2006 2:19 PM

Thank you very much ,but isn't this different from the command gcc ?
The tutorial shows another command which is g++ .
Moreover , I am still receiving the smae message.

Infinite Recursion Feb 24th, 2006 2:22 PM

gcc ./filename.c
gcc ./filename.cpp

notice the ./ make sure you include it.

Cipher Feb 24th, 2006 2:24 PM

gcc -x c++ filename.cpp

-The "-x" option with c++ after it specifies the language.

or

g++ filename.cpp

-You can also use g++ to compile c++ code.

If you're using C code, then just do this:

gcc filename.c

verb1426 Feb 26th, 2006 12:19 PM

Thank you .....it worked ,but not like A dream :) due to my bad program :o
Thank you all.
Verb1426


All times are GMT -5. The time now is 11:02 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC