![]() |
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 |
|
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. |
gcc ./filename.c
gcc ./filename.cpp notice the ./ make sure you include it. |
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 |
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