gcc , cc , g++
what do the switched -c and -o do?
Whats the difference between g++ , gcc and cc (and what are advantages of them?). |
also how is it possible to compile my code into a win32 app if needed?
|
I'm no expert to C or C++ or linux, i just started using linux actually. But gcc i believe is gnu free compiler for C, g++ the gnu free compiler for C++ and cc... well you got me, i gots no idea. Hope that helps. Oh... and compiling programs for win32... I think you'd probably have to run Wine, or something. Hope that helps somehow.
|
try
man gcc example for compiling a c program: gcc helloworld.c -o helloworld then you can execute like this: ./helloworld -c Compile or assemble the source files, but do not link. The compiler output is an object file corre_ sponding to each source file. -o file Place output in file file. This applies regardless to whatever sort of output GCC is producing, whether it be an executable file, an object file, an assembler file or preprocessed C code. |
Thanks very much. ;-)
|
g++ is the compiler for c++, gcc is for c, and I don't think cc is a compiler at all.
if you code something in c++, to run it do something like this: ./g++ -o [executable] [source] so it would look like: ./g++ -o foo foo.cpp -o specifies the name out of the ouput file (if you don't use it, your output file is, be default, named "a.out"). as mentioned before, -c just compiles it and doesn't link it (good for quick debugging purposes). hope this helps ti |
All times are GMT -5. The time now is 07:10 PM. |