This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
A question about the -c option
- To: gcc-help at gcc dot gnu dot org
- Subject: A question about the -c option
- From: Ricardo Colon <rcolon at andrew dot cmu dot edu>
- Date: Wed, 25 Oct 2000 17:04:58 -0400 (EDT)
- cc: Ricardo Colon <rcolon at andrew dot cmu dot edu>
- Reply-To: Ricardo Colon <rcolon at andrew dot cmu dot edu>
Does anyone know how to do the following.
I have a test.c file with no main function. It just has methods.
What I want to do is to compile an object file(i.e. test.o) from this
code.
Apparently -c means compile, but don't link at all.
Unfortunately, my source code uses function from a shared library, which
means that I need to link.
Anyone know how to do this? I want a test.o file. Having a main method
would cause the resulting file to be a.out executable(which is not what I
want).
However, leaving out the main method, gives me an
"/usr/lib/crt1.o undefined reference to main" error. I'm using Redhat 6.2,
which comes with egcs-2.91.66
Any ideas?
Thanks.