Advertisement

Lack of tutorials: C++ and GCC

Started by December 06, 2003 06:53 PM
3 comments, last by GBGames 20 years, 11 months ago
I have been searching Google for some time now, and I have tried to avoid this, but it has gotten to the point that I just can''t find the information I am looking for. I have decided to finally ask for help here. I find plenty of tutorials about programming in C with GCC, but not nearly as much about C++. I even checked a few of my Linux game programming books and they use C as well. Programming in C++ isn''t the problem so much as how to use GCC. I am very unfamiliar with GCC, and while I find plenty of documentation about it, it is always about C, with a passing mention of all the other languages it supports. Anyway, does anyone have any good resources/links/books on using GCC with C++? I have only used C++ with Visual C++ on my Windows system, and I wanted to learn how to develop for Gnu/Linux now. Even if you could just tell me what search terms might help more than "C++ GCC tutorial" and "G++ howto", then that would be a big help.
-------------------------GBGames' Blog: An Indie Game Developer's Somewhat Interesting ThoughtsStaff Reviewer for Game Tunnel
What do you want to understand? The C++ language or specifically the options for G++?

Plenty of good books on C++ and GCC is a fairly good C++ compiler and supports mostly everything.

If you want to know the command line options do ''man g++'' or "g++ --help" at the command line.
Advertisement
gcc is a C compiler, try g++.
Hmm... What do you need to know?

BTW, you want to use "g++" with C++ source, not "gcc". g++ is
a wrapper to set some options correctly before invoking
gcc.

Typing "man g++" should give you a place to start.

To compile a single file, do this:

g++ myprog.cpp -o myprog 


That''s about it... Really.


Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
Ok, in my research, here is what I found:

GCC is the Gnu Compiler Collection. It is not a C compiler but a collection of all sorts of compilers. g++ is a frontend to gcc that basically says, "Here are some parameters to say that the files to compile are C++"

In any case, I thought there was something I was doing incorrectly with parameters and libraries. Turns out that my file was including the wrong library. Seems I am rustier than I thought. From my original post, it turns out that my problem WAS programming in C++ rather than how to use GCC B-)

So yeah, I have found a lot more information in the past 24 hours, and gcc/g++ seems to be working out fine. I can look up more when I need to do with a bit more confidence. I also need to look over my make tutorial printouts from last year or so.

Still, thanks for your help, guys.
-------------------------GBGames' Blog: An Indie Game Developer's Somewhat Interesting ThoughtsStaff Reviewer for Game Tunnel

This topic is closed to new replies.

Advertisement