Operating System - HP-UX
1751961 Members
4661 Online
108783 Solutions
New Discussion юеВ

Re: Error: ld: Unsatisfied symbol

 
Anwarul Kabir
Advisor

Error: ld: Unsatisfied symbol

Whats does this error means?

splbatdv@hp66ap23|[/app/dvlp/splbatdv/splbatch/build/exe/validate/src] > make
aCC +DD64 -AA -z -g -mt -DSTD_AA +Z -I/oracle/product/10.2.0/rdbms/public -I/oracle/product/10.2.0/network/public -I. -I../inc -I../../../lib/db_ob/inc -I../../../lib/utility/inc -I../../../lib/xml/inc -I/app/dvlp/common/xerces/include/ -I/app/dvlp/common/Secure/C++/inc -c reporter.cpp
aCC +DD64 -AA -z -g -mt -DSTD_AA +Z -I/oracle/product/10.2.0/rdbms/public -I/oracle/product/10.2.0/network/public -I. -I../inc -I../../../lib/db_ob/inc -I../../../lib/utility/inc -I../../../lib/xml/inc -I/app/dvlp/common/xerces/include/ -I/app/dvlp/common/Secure/C++/inc -c db_reporter.cpp
aCC +DD64 -AA -z -g -mt -DSTD_AA +Z -I/oracle/product/10.2.0/rdbms/public -I/oracle/product/10.2.0/network/public -I. -I../inc -I../../../lib/db_ob/inc -I../../../lib/utility/inc -I../../../lib/xml/inc -I/app/dvlp/common/xerces/include/ -I/app/dvlp/common/Secure/C++/inc -c transaction_error_table.cpp
aCC +DD64 -AA -z -g -mt -DSTD_AA +Z -I/oracle/product/10.2.0/rdbms/public -I/oracle/product/10.2.0/network/public -I. -I../inc -I../../../lib/db_ob/inc -I../../../lib/utility/inc -I../../../lib/xml/inc -I/app/dvlp/common/xerces/include/ -I/app/dvlp/common/Secure/C++/inc validate.cpp reporter.o db_reporter.o transaction_error_table.o -L/oracle/product/10.2.0/lib -lclntsh -L../../../lib/xml/lib -lxml -L../../../lib/db_ob/lib -ldb_ob -L../../../lib/utility/lib -lutility -L/app/dvlp/common/xerces/lib -lxerces-c -L/app/dvlp/common/Secure/C++/lib -l:libnaicsec2.a -Wl,-B,immediate,+n -o validate
ld: Unsatisfied symbol "EVP_CipherInit_ex" in file /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]
ld: Unsatisfied symbol "EVP_CIPHER_CTX_cleanup" in file /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]
ld: Unsatisfied symbol "EVP_des_ede3_ecb" in file /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]
ld: Unsatisfied symbol "EVP_CIPHER_CTX_init" in file /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]
ld: Unsatisfied symbol "EVP_CipherUpdate" in file /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]
ld: Unsatisfied symbol "EVP_CipherFinal_ex" in file /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]
6 errors.
*** Error exit code 1

Stop.


I am clue less where to look. I am converting this running application from 32bit HP to 64bit HP box and still can't able to compile the application.

As you can see this one is trying to access a shared library and giving me the error. I can't even look at the library as its a .a file.

So please help.
10 REPLIES 10
Anwarul Kabir
Advisor

Re: Error: ld: Unsatisfied symbol

I think in my make file this line is not working

validate: validate.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(INCLUDES) $@.cpp $(OBJECTS) $(LIBS) $(DEFINES) $(LDOPTS) -o $@
# chatr -s +b disable +s enable $@


Because the next two lines are
mv $(EXES) ../bin/
mv $(OBJECTS) ../obj/

but after it errors out I see all the object files r seating in the src folder and it wasn't moved to obj or bin like those to lines...
Anwarul Kabir
Advisor

Re: Error: ld: Unsatisfied symbol

Attached is the make file
James R. Ferguson
Acclaimed Contributor

Re: Error: ld: Unsatisfied symbol

Hi:

You should be able to use 'nm' to see the symbols in your *.a" archive. see the manpages for more information. Another useful resource is:

http://docs.hp.com/en/9482/linkhelp.html

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Error: ld: Unsatisfied symbol

>I am clueless where to look. I am converting this running application from 32bit HP to 64bit HP box and still can't able to compile the application.

Going from 32 to 64 won't have this problem unless you forgot to compile a lib.
Also you are able to compile fine, you just can't link.

>As you can see this one is trying to access a shared library and giving me the error.

I see an archive lib. And you are linking with +n, so it isn't an ordering problem.

>I can't even look at the library as its a .a file.

Why not? As JRF says, you can use nm(1).

If you want to search for those symbols you can use:
nm -pxAN /app/dvlp/common/Secure/C++/lib/lib* |
grep -e EVP_CipherInit_ex -e EVP_CIPHER_CTX_cleanup

>Because the next two lines are ... but after it errors out I see all the object files are seating in the src directory

Those mv lines aren't executed if the link fails.
Anwarul Kabir
Advisor

Re: Error: ld: Unsatisfied symbol

So I did the grep command and I can see its returning me the symbols so now what?

splbatdv@hp66ap23|[/app/dvlp/common/Secure/C++/lib] > nm -pxAN /app/dvlp/common/Secure/C++/lib/lib* |
> grep -e EVP_CipherInit_ex -e EVP_CIPHER_CTX_cleanup
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2-old.a[PropertiesDao.o]:EVP_CipherInit_ex
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2-old.a[PropertiesDao.o]:EVP_CIPHER_CTX_cleanup
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2-old.sl:EVP_CipherInit_ex
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2-old.sl:EVP_CIPHER_CTX_cleanup
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]:EVP_CipherInit_ex
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2.a[PropertiesDao.o]:EVP_CIPHER_CTX_cleanup
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2.sl:EVP_CipherInit_ex
0x0000000000000000 U /app/dvlp/common/Secure/C++/lib/libnaicsec2.sl:EVP_CIPHER_CTX_cleanup
Anwarul Kabir
Advisor

Re: Error: ld: Unsatisfied symbol

Actually I am getting five of them back one is missing

nm -pxAN libnaicsec2.a | grep -e EVP_CipherInit_ex -e EVP_CIPHER_CTX_init -e EVP_des_ede3_ecb -e EVP_CIPHER_CIX_cleanup -e EVP_CipherUpdate -e EVP_CipherFinal_ex


0x0000000000000000 U libnaicsec2.a[PropertiesDao.o]:EVP_CipherInit_ex

0x0000000000000000 U libnaicsec2.a[PropertiesDao.o]:EVP_CipherUpdate

0x0000000000000000 U libnaicsec2.a[PropertiesDao.o]:EVP_CipherFinal_ex

0x0000000000000000 U libnaicsec2.a[PropertiesDao.o]:EVP_CIPHER_CTX_init

0x0000000000000000 U libnaicsec2.a[PropertiesDao.o]:EVP_des_ede3_ecb

Only EVP_CIPHER_CIX_cleanup symbol is missing. Can one missing symbol cause the error for others? and What do i need to do to fix this...
Dennis Handly
Acclaimed Contributor

Re: Error: ld: Unsatisfied symbol

>I am getting five of them back one is missing

You should get all that you search for.

>nm -pxAN libnaicsec2.a | grep -e EVP_CipherInit_ex -e EVP_CIPHER_CTX_init -e EVP_des_ede3_ecb -e EVP_CIPHER_CIX_cleanup -e EVP_CipherUpdate -e EVP_CipherFinal_ex

You are suppose to add every lib to nm so you can find where it is defined.

>Only EVP_CIPHER_CIX_cleanup symbol is missing.

You have a typo for EVP_CIPHER_CTX_cleanup.

>Can one missing symbol cause the error for others?

Possibly only for dld and shlibs.

>What do I need to do to fix this?

Find the lib where these are defined. Where do you think they should be defined?
Take a look at your 32 bit application, where it works.
Anwarul Kabir
Advisor

Re: Error: ld: Unsatisfied symbol

I fixed the typo and now i am getting all 6 missing symbols. Now what should I do?

Unfortunately I can't see the application running as I don't have access to that box...

Anwarul Kabir
Advisor

Re: Error: ld: Unsatisfied symbol

I found the solution but not sure why it wasn't working

changed this
Replace this line
-L$(SECDIR)/lib -l:libnaicsec2.a
With this line
-L$(SECDIR)/lib -lnaicsec2


in the make file and it started to work...