C (109/257)

From:
Date:10 Feb 2001 at 17:23:28
Subject:Re: Help with gcc

Donald wrote:
> I have downloaded the latest gcc from Aminet.
The one on aminet in the geekgadgets dir is very old, get gcc from
geekgadgets.org. This will solve a lot of problems. Also there is a
guide to what is needed for standard setup. You may need some files
from the alpha directory.

> What are makefiles and how do I use them?
You create them via configure. Read the docs section on creating them
since I have not used it yet.

> Can someone give me a few examples of how to compile and link a
> program
> (For example, I have source files Test1.cpp, Test2.cpp & Test.h)?
Simple.
gcc -c -o Test1.o Test1.cpp
will create object file called Test1.o from Test1.cpp. The -o is for
output(in this case Test1.o), the -c is so it wont link with anything.

So you do that for all files eg.
gcc -c -o Test1.o Test1.cpp
gcc -c -o Test2.o Test2.cpp

Then to link you do
gcc -o Test Test1.o Test2.o

As you may have noticed the gcc command is clever and calls the
linker and assembler(and the rest) by itself.

> Where do I need to put the system includes so gcc can find them
> (they're currently in StormC3's "Include" directory)?
The latter versions(and download 2.95.1) use os-include for the os
includes, but download fd2pragma from aminet to create the inlines
for gcc.

> Finally, I've been trying to invoke g++ and make to find out how
> they work but each time I do I get 01000005 GURU's which
> are 'Corrupt memory list in FreeMem(). Why?
Most likely this is a stack size issue, increase it to 200,000. Also
as it is a port from unix remember they need lots of stack.

Shinda

------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://click.egroups.com/1/11231/0/_/451227/_/981822211/
---------------------------------------------------------------------_->