Operating System - Linux
1748123 Members
3437 Online
108758 Solutions
New Discussion юеВ

Re: ld: Unsatisfied symbol Error

 
SOLVED
Go to solution

ld: Unsatisfied symbol Error

Hi all,

I find following error when make a libabry in Hp-unix.

ld: Unsatisfied symbol "1" in file
ld: Unsatisfied symbol "stop_missing_startup_param" in file mtamain.o
ld: Unsatisfied symbol "MSP_GetInstanceIdByName" in file mtamain.o
ld: Unsatisfied symbol "initialise_rlylib" in file /home/juan/subrat/OMNI33B/SHA
RED/libsmsg_rly.a[smsglib.o_]
ld: Unsatisfied symbol "MSP_GetInstanceIdByName" in file mtamain.o

I have compile with
CC = g++ -mlp64 -Wall -funsigned-char.

Something wrong i dont understand since some MSP call properly...but some given error.

Please anyone help me....

Regards,
subrat
7 REPLIES 7
Dennis Handly
Acclaimed Contributor

Re: ld: Unsatisfied symbol Error

For the symbol "1", are you using -u1? this would get translated to the unsat for "1".
As to your other symbols, where are they defined? If they are defined in an archive, that archive must follow the object file mtamain.o on the command line. The same with your unsat in libsmsg_rly.a. Your archive libs must be ordered. If this is too hard, you can use -Wl,+n to cause the linker to keep searching until it can't find it.

Re: ld: Unsatisfied symbol Error

Hi
First of all Thanks ..

I have used -u1 but symbol "1" is not gone.
When using -Wl,+n some of error is gone...and some are present.
make file is working for c good...
but when compile with g++ -mlp64
then its given Unsatisfied symbol error.
My archive lib is define in another dir.
which is in order.

Please comment...
A. Clay Stephenson
Acclaimed Contributor

Re: ld: Unsatisfied symbol Error

Unsatisfied symbol "1" in file

This has to be a problem in your makefile itself. I would guess that you have a syntax error in one of your dependency rules.

First make sure that each action statement begins with a . Make is one of the very few UNIX utilities where the presense of a rather than simply whitespace is critical. Also, you aren't using gmake makefiles under HP-UX make are you? Gmake has some extensions that make does not understand.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: ld: Unsatisfied symbol Error

>I have used -u1 but symbol "1" is not gone.

I'm not sure what this means? I said to remove -u1. Pass -v to ld to make sure it isn't there.

>makefile is working for C good... but when compile with g++ -mlp64 then its given Unsatisfied symbol error.

I'm not sure what this means? Are you saying your makefile template works for C, therefore you assume it will work for C++?

As in all cases with unsats, where is the references? Where is it defined? Can you prove this by using nm?

$ nm -pxAN libs objects | fgrep -e symbol -e symbol2 ...

You can ask ld to print some of them: -Wl,-ystop_missing_startup_param

And if you can't find it, you may have to use grep on the sources.

Re: ld: Unsatisfied symbol Error

Hi Dennis Handly,

Thanks.


I have remove -u1 from my makefile...
"1" unsatisfied symbol is gone.
can you tell me what is means of -u1..
please describe..
Dennis Handly
Acclaimed Contributor

Re: ld: Unsatisfied symbol Error

>can you tell me what is means of -u1.

I'm not sure what you want it to be but the -u option to ld says to treat the symbol "1" as a symbol and make it unsatisfied. Typically it is used to extract an object out of an archive. See ld(1).
Dennis Handly
Acclaimed Contributor
Solution

Re: ld: Unsatisfied symbol Error

If you have gotten the answers you wanted, please see:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33