|
Home > Archive > Unix Programming > January 2004 > Problems with crt1.o of SunStudio8
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problems with crt1.o of SunStudio8
|
|
|
| Hi there!
First I have to thank you all, you've been great help!
But as you all know problems never end, so here's another one of me:
I need help on a compiler message I don't understand. I use the CC of
SunStudio8 on a SunSparc Solaris8.
My code compiles without errors expect for one error occuring in all
compilations. It says:
Undefined first referenced
symbol in file
main
/home/cp0933/disk01/ya_lokal/WIS/opt/SUNWspro/prod/lib/crt1.o
Can anyone tell me what to do?
Is this critical?
Can I use my object anyway?
Micha
| |
| Jeff Schwab 2004-01-29, 12:35 am |
| Micha wrote:quote:
> Hi there!
>
> First I have to thank you all, you've been great help!
> But as you all know problems never end, so here's another one of me:
>
> I need help on a compiler message I don't understand. I use the CC of
> SunStudio8 on a SunSparc Solaris8.
>
> My code compiles without errors expect for one error occuring in all
> compilations. It says:
>
>
> Undefined first referenced
> symbol in file
> main
> /home/cp0933/disk01/ya_lokal/WIS/opt/SUNWspro/prod/lib/crt1.o
>
> Can anyone tell me what to do?
> Is this critical?
> Can I use my object anyway?
>
> Micha
When you compile, use the "-c" flag.
| |
| joe durusau 2004-01-30, 3:36 am |
|
Jeff Schwab wrote:
quote:
> Micha wrote:
>
> When you compile, use the "-c" flag.
To the O.P.: You need to specify exactly what you are trying to do.
As Micha suggests, using -c will eliminate the error. It will make the
compiler output a .o file (that is, a relocatable object file). If that's
what
you want, no further problem. If you leave out the -c flag, the compiler
attempts to link the input files into an executable output file, which by
default will be called a.out. That file must contain a function named main
if it is to execute on a Sun Solatis system.
Speaking only for myself,
Joe Durusau
|
|
|
|
|