Operating System - HP-UX
1752786 Members
5599 Online
108789 Solutions
New Discussion юеВ

/usr/ccs/bin/ld: Unsatisfied symbols:

 
Jay C. Quibuloy
Occasional Advisor

/usr/ccs/bin/ld: Unsatisfied symbols:

Hi
when i try to issue cc in command prompt.
i get the following error.

#cc
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)


Could anyone knows how to resolve this problem.

thanks.
12 REPLIES 12
Dietmar Konermann
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

Hmm... you know that cc is the C compliler. So you should specify something to compile...
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jay C. Quibuloy
Occasional Advisor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

Yup i know. but when i try to issue the command to the other machine with same O.S.,same software installed theres no error messages display.

# uname -a
HP-UX SERVER1 B.11.11 U 9000/800 119907872 unlimited-user license
# cc
#

Server with error.
# uname -a
HP-UX PPCHK B.11.11 U 9000/800 2758389902 unlimited-user license
# cc
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)


do i need to re-install the HP C/ANSI C Developer's Bundle for HP-UX 11.i (S800)

thanks
Muthukumar_5
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

hai,

I have tested on 11.23 as
# cc
It is normal. no error message.

What is cc -v saying. Use the verbose type in ld. cc is working fine. ld is stating the problem.


Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
sreejith_4
Frequent Advisor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

Hi,

Issue which cc and let us know the cc path.
There could be some library version mismatch.
Normally /usr/ccs/bin/cc is link file.
You should have the LD_LIBRARY_PATH set with the following,
/usr/lib:/opt/langtools/lib

Thanks
Sreejith M
Dietmar Konermann
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

Ah, now I understand the question. :) Just checked on some of our systems... lokks like newer versions of the ANSI C bundle always call ld, which then prints the error message.

grcdg319[nero]:/tmp # swlist -l product |grep -i ansi
C-ANSI-C B.11.11.10 HP C/ANSI C Compiler
grcdg319[nero]:/tmp # cc -v
cc: informational note 404: NLSPATH is /opt/ansic/lib/nls/msg/%L/%N.cat:/opt/ansic/lib/nls/msg/C/%N.cat:
cc: informational note 404: INCLUDIR is INCLUDIR=/usr/include
cc: informational note 404: LPATH is /usr/lib:/opt/langtools/lib:
/usr/ccs/bin/ld /opt/langtools/lib/crt0.o -u main -lc
cc: informational note 413: Entering Link editor.
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)

hprtdu22[dumpy]:/# swlist -l product |grep -i ansi
C-ANSI-C B.11.11.02 HP C/ANSI C Compiler
hprtdu22[dumpy]:/# cc -v
cc: NLSPATH is /opt/ansic/lib/nls/msg/%L/%N.cat:/opt/ansic/lib/nls/msg/C/%N.cat:
cc: CCOPTS is not set.
cc: INCLUDIR is INCLUDIR=/usr/include

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jay C. Quibuloy
Occasional Advisor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:


# cc -v
cc: informational note 404: NLSPATH is /opt/ansic/lib/nls/msg/%L/%N.cat:/opt/ansic/lib/nls/msg/C/%N.cat:
cc: informational note 404: INCLUDIR is INCLUDIR=/usr/include
cc: informational note 404: LPATH is /usr/lib:/opt/langtools/lib:
/usr/ccs/bin/ld /opt/langtools/lib/crt0.o -u main -lc
cc: informational note 413: Entering Link editor.
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)
#
Muthukumar_5
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

hai,

It is the problem because of ld.

Execute /usr/ccs/bin/ld -umain -lc
It will state the problem in all machines as like your's when it is executed separately.But In your system, ansi cc is linked with ld with -u main to execute the particular ld command.

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
Jay C. Quibuloy
Occasional Advisor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

Hi Dietmar

Thats exactly what we have. So What we gonna do. Its that a bug or what?

what should be the advantage and disadvantage of the newer version.

thanks.


Muthukumar_5
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied symbols:

By default,

cc is executed as /usr/ccs/bin/ld /opt/langtools/lib/crt0.o -u main -lc command without any file.

So it will state the error messages. change to another ansi bundle if you don't want to have this error messages. You can verify from konerman's output of different cc.

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!