On Sun, May 12, 2002 at 08:16:50PM -0600, Blake Thornton wrote:

> I'm stuggling learning C++ and was hoping someone could point me to a
> source for help.  The language is not the problem (I think I can figure
> out the language issues) but I'm having trouble compiling and linking from
> multiple source files (using make or not using make).
> 
> Can anyone point me to a very basic tutorial on using the g++ compiler
> (I have not found gcc.gnu.org to be very basic)
> 
> Thanks!

First, you should check out the Linux C++ list, at
http://lists.linux.org.au

Second, if you're familiar with compiling and linking in some other
language, then GNU C++ is very little different. Without seeing error
messages, it's hard to say where you're going wrong. Some tips, though:

1) Ensure you're #include-ing the proper files in your source. If you're
using templates, for example, ensure you #include <template>. Also note
that with C++, most included files _do not_ include the .h extension.

2) Ensure you're linking with the proper libraries. If you're using
straight C++, then this isn't an issue. Else, it is.

3) If you're going to work with multiple sources, use make. There are
man pages, and the O'Reilly book: "Managing Projects with make". GNU
make may be a little off from what's in the book, so refer to the man
pages with any questions like that.

4) If you're going to use make, find a makefile from a project that
works, and analyze it using the man pages and the O'Reilly book.
Caution: _do not_ select a project whose makefile is built with
autoconfig (a project where you issue "make config" first); the
makefiles are too complex.

HTH,

Paul



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to