Advertisement

Linux and gcc (how to use it???)

Started by June 25, 2003 05:21 AM
2 comments, last by exa_einstein 21 years, 4 months ago
I have installed my Linux (mandrake) last week and now I need to compile and link some C++ code under it. I have found gcc, but HOW CAN I USE IT? have tried "man gcc" but that documentation has more than thousand lines and I don''t want to read it. How can I compile and run simple .cpp file? please help
When I was younger, I used to solve problems with my AK-47. Times have changed. I must use something much more effective, killing, percise, pernicious, efficient, lethal and operative. C++ is my choice.
Just typing "gcc simple.cpp" should do it. That will compile and link and probably output something like a.out or whatever type of binaries your system uses. Normally you''ll use makefiles though. Do a google on that, shouldn''t be hard to find tutorials.
Advertisement
It''s a big online manual, but its broken into sections, easier to follow.

http://gcc.gnu.org/onlinedocs/

Being I''m a nice guy, I google''d this, I did a pass, looks like a good first start.

http://galton.uchicago.edu/~gosset/Compdocs/gcc.html

Int
compile file(s):

g++ -c sourcename.cpp

link file(s)

gcc *.o -lmylib -lanotherlib -o outputfilename
our new version has many new and good features. sadly, the good ones are not new and the new ones are not good

This topic is closed to new replies.

Advertisement