Languages and Scripting

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

 
Geetha Ramanujam
Occasional Advisor

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

Hi ,
I get the following error
/usr/ccs/bin/ld: Unsatisfied symbols:
f1_func() (first referenced in ack_maint.o) (code)

The makefile reads as follows:
ack_maint :: ack_maint.c \
-llogtrc -lsvmsg -lcommon -lcommon_tm -ldbms
-ldld

Actually f1_func() is a function which is in the library common_tm.

Could anyone let me know how should i resolve this problem?
7 REPLIES 7
ranganath ramachandra
Esteemed Contributor

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

from the message, it appears that this is a PA32 link. can you check whether f1_func is actually in the export list of libcommon_tm.sl with 'odump -slexportlist libcommon_tm.sl' ? it may not be there if it had been defined static or was hidden with a '-h' linker option (or hidden indirectly due to a '+e' linker option) while building libcommon_tm.sl.
 
--
ranga
(i work for hpe)

Accept or Kudo

Geetha Ramanujam
Occasional Advisor

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

This function is not in the export list of libcommon_tm.a
Zeev Schultz
Honored Contributor

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

Well for a build purposes only (later seek that symbol, run ldd etc) use +allowunsats option with ld.
So computers don't think yet. At least not chess computers. - Seymour Cray
ranganath ramachandra
Esteemed Contributor

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

what do you mean when you say "f1_func() is a function which is in the library common_tm" ?

by default the linker tries to link with a shared library (libcommon_tm.sl) if that is available. if not, it links in the archived library (libcommon_tm.a).

if you have the shared library, you should be looking for this symbol in its export list. if you have only the archived library, you should look for the symbol in its symbol table : please post the output of 'odump -sym libcommon_tm.a | grep f1_func'.

you can also add '-y f1_func' to the end of your link command to see where the reference is and where the definition is.
 
--
ranga
(i work for hpe)

Accept or Kudo

Elmar P. Kolkman
Honored Contributor

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

Could you post the complete output of the make command? I think your problem is that the link doesn't include the -l options you try to include.
You could also try to build without the makefile:
cc -o ack_maint ack_maint.c -llogtrc -lsvmsg -lcommon -lcommon_tm -ldbms -ldld

Every problem has at least one solution. Only some solutions are harder to find.
shakeel_4
New Member

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

Hi,
I also get a similar error when I try to do 'nmake all'

/usr/ccs/bin/ld: Unsatisfied symbols:
sd_edalnum(char *,int,int) (first referenced in /users/gss/nmanikan/gss04.10/lib/libsdlist.a(sd_val.o)) (code)
sd_edtdig(char *,int,int) (first referenced in /users/gss/nmanikan/gss04.10/lib/libsdlist.a(sd_val.o)) (code)
/usr/ccs/bin/ld: Found 121 duplicate symbol(s)
make: *** exit code 1 making tmf

Can anyone suggest good ideas to solve it.

Thanks in advance !

-Shakeel
Geetha.R
Occasional Advisor

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

Shakeel,

Since I had defined the function to be a static function , I got the error. Since the scope of the static function is limited. Is your function a static function?

Geetha