PDA

View Full Version : C++ Compiler in Bash



dehahn
09-27-2004, 06:54 AM
Could somebody please inform me on how the C++ compiler in bash shell works for Knoppix 3.3? I'm currently only running Linux from the bootable CD. I know the command g++ <and filename.C>, but this only starts the debugger from the look of things. However, what command actually starts running the compiler?

Cheers,

Danny

fordfasterr
09-27-2004, 08:00 PM
i think you are on the right track here..

this is what you have to do..

first, save your source code file with extension.. .cpp (ie. hello.cpp)

next, to compile your program, type:

c++ hello.cpp -o hello <enter>

and that will compile the code and output the file to hello

then to run the program, type:

./hello <enter>

!!!!!!!!!!! GOOD LUCK ! :)

user unknown
09-27-2004, 11:57 PM
agreeing mostly, but the common extension on linux is .cc - not .cpp (or .c).
.c are c-Files for gcc (gcc your.c -o your)

dehahn
10-14-2004, 07:20 AM
Thank you for the Help. I'll now give it a try.

Danny

user unknown
10-16-2004, 01:31 AM
and normally it's g++ - the gnu-c++-compiler.