Solaris 5.8: gcc - > getopt_long and ld: fatal error: ....

Solaris 5.8: gcc - > getopt_long and ld: fatal error: ....

Post by Clemens Wys » Sat, 07 Jul 2001 23:39:50



Hi,
I try to compile gcvs on my solaris 5.8 with gcc.
When linking I get:
--------------
Undefined               first referenced
  Symbol                     in file
getopt_long                     main.o
ld: fatal: Symbol referencing errors. No output written to cvstree
---------------

How can I circumvent this linker error?
Please cc to my private email as I am "a not too frequent" visitor ;-)
Regards
Clemens

 
 
 

Solaris 5.8: gcc - > getopt_long and ld: fatal error: ....

Post by Joerg Schilli » Sun, 08 Jul 2001 01:17:15




Quote:>Hi,
>I try to compile gcvs on my solaris 5.8 with gcc.
>When linking I get:
>--------------
>Undefined                   first referenced
>  Symbol                         in file
>getopt_long                         main.o
>ld: fatal: Symbol referencing errors. No output written to cvstree
>---------------

>How can I circumvent this linker error?

Correct your C source. getopt_long() is not a standard interface on
--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

Solaris 5.8: gcc - > getopt_long and ld: fatal error: ....

Post by Rachel Polansk » Tue, 10 Jul 2001 12:01:42






>>Hi,
>>I try to compile gcvs on my solaris 5.8 with gcc.
>>When linking I get:
>>--------------
>>Undefined               first referenced
>>  Symbol                     in file
>>getopt_long                     main.o
>>ld: fatal: Symbol referencing errors. No output written to cvstree
>>---------------

>>How can I circumvent this linker error?

> Correct your C source. getopt_long() is not a standard interface on

I stole the getopt_long function & its header from another package that
included it (I think it was Mysql).  I compiled it to an object
and linked it with the rest of the code.  I believe getopt_long is
part of glibc - ie more Linuxisms you have to overcome to port some
so called "Open Source" software to Solaris.  

rachel

--

UNIX Administrator                      100 Harris Street
IT Operations                           Pyrmont, Sydney NSW

 
 
 

Solaris 5.8: gcc - > getopt_long and ld: fatal error: ....

Post by Newbie JrSysAdm » Tue, 10 Jul 2001 13:20:21







> >>Hi,
> >>I try to compile gcvs on my solaris 5.8 with gcc.
> >>When linking I get:
> >>--------------
> >>Undefined                  first referenced
> >>  Symbol                        in file
> >>getopt_long                        main.o
> >>ld: fatal: Symbol referencing errors. No output written to cvstree
> >>---------------

> >>How can I circumvent this linker error?

> > Correct your C source. getopt_long() is not a standard interface on

> I stole the getopt_long function & its header from another package that
> included it (I think it was Mysql).  I compiled it to an object
> and linked it with the rest of the code.  I believe getopt_long is
> part of glibc - ie more Linuxisms you have to overcome to port some
> so called "Open Source" software to Solaris.  

> rachel

no, it seems you didn't do that.

the linker error message indicates the symbol isn't found. that's not
"linuxism"- that's compiling. why don't you simply include the header
file in your source and compile again?

 
 
 

Solaris 5.8: gcc - > getopt_long and ld: fatal error: ....

Post by Joerg Schilli » Tue, 10 Jul 2001 16:55:36




>> >>When linking I get:
>> >>--------------
>> >>Undefined              first referenced
>> >>  Symbol                    in file
>> >>getopt_long                            main.o
>> >>ld: fatal: Symbol referencing errors. No output written to cvstree
>> >>---------------

>> >>How can I circumvent this linker error?

>> > Correct your C source. getopt_long() is not a standard interface on

>> I stole the getopt_long function & its header from another package that
>> included it (I think it was Mysql).  I compiled it to an object
>> and linked it with the rest of the code.  I believe getopt_long is
>> part of glibc - ie more Linuxisms you have to overcome to port some
>> so called "Open Source" software to Solaris.  
...
>the linker error message indicates the symbol isn't found. that's not
>"linuxism"- that's compiling. why don't you simply include the header
>file in your source and compile again?

As you already found out: it is a linker error so it definitely helps
to add a header file!

getopt_long() is neither part of traditional UNIX nor part of any open
OS standard. It is just a FSF proprietary interface! If you find a
program that _needs_ it and does not incorporate it, it is proof for
an author with low portability knowldge.

--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

1. gcc-2.5.8 -> gcc-2.6.3 Help I get an error

Could someone please help me upgrade gcc-2.5.8?  I am trying to go to either
2.6.2 or 2.6.3.  Both of them give me the same error.

First I 'configure', and that seems to work fine.  But then I do a
'make LANGUAGES=c' and it starts off fine:

cc  -DIN_GCC -DPOSIX  -g     -I. -I. -I./config \
  -DGCC_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/i486-unknown-linux/2.6.2/include\" \
  -DGPLUSPLUS_INCLUDE_DIR=\"/usr/local/lib/g++-include\" \
  -DLOCAL_INCLUDE_DIR=\"/usr/local/include\" \
  -DCROSS_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/i486-unknown-linux/2.6.2/sys-include\" \
  -DTOOL_INCLUDE_DIR=\"/usr/local/i486-unknown-linux/include\" \
  -c `echo ./cccp.c | sed 's,^\./,,'`

... but then gives me some errors about not being able to find some
header files:

In file included from cccp.c:74:
/usr/include/sys/types.h:4:   linux/types.h:  No such file or directory

and a couple others with stat.h, signal.h, fcntl.h, and errno.h.  This
seems to be an error in cccp.c, since /usr/include/sys/types.h DOES
exit on my system.  There isn't even a linux directory in the package,
I don't think, so why is it looking for linux/types.h?

Any help would be great.

-Aaron

2. xdm and subnet or local lan

3. gcc and/or ld is slow on x86 solaris 5.8

4. begginer...

5. Help me please:gcc internal compiler error:fatal signal 6/ld.so.4

6. too much cpu utilization on socket read

7. boot prompt option for dual pentium

8. Help with gcc: Internal compiler error: program ld got fatal signal 11

9. gcc-2.5.8 ==> 2.6.x soon?

10. gcc 2.5.7 comp. errors with lib4.5.8

11. ld.so.1: <app name>: fatal: relocation error