Operating System - HP-UX
1827808 Members
13671 Online
109969 Solutions
New Discussion

Re: compiling shared libraries question

 
Jimmy Tom_2
Frequent Advisor

compiling shared libraries question

Have a rp3440 machine up and running and are busy porting our software to it. I have run into a problem when trying to build a shared library. Here is the output of the build process - which seems to run just fine:

ld -b -o libz.sl.1.1.3 adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o +h zlib.dll

ld: (Warning) At least one PA 2.0 object file (adler32.o) was detected. The linked output may not run on a PA 1.x system.

rm -f libz.sl libz.sl.1
ln -s libz.sl.1.1.3 libz.sl
ln -s libz.sl.1.1.3 libz.sl.1
cp libz.sl /home/intergy/Code/Shared/Core/bin/ZipUtility/zlib.dll
chmod 777 /home/intergy/Code/Shared/Core/bin/ZipUtility/zlib.dll

The last two lines copy the library to our directory and sets it to be world executable/writeable/readable ...

When I try to use it from within our system, I get this message:

/usr/lib/pa20_64/dld.sl: '/home/intergy/Code/Shared/Core/bin/ZipUtility/zlib.dll' is not a valid load module: Bad magic number

When looking at the file using the UNIX file command, I get:

file /home/intergy/Code/Shared/Core/bin/ZipUtility/zlib.dll
/home/intergy/Code/Shared/Core/bin/ZipUtility/zlib.dll: PA-RISC2.0 shared library -not stripped

Which looks all right to me. Anyone knows how I can get around this? Thanks in advance.

2 REPLIES 2
Geoff Wild
Honored Contributor

Re: compiling shared libraries question

Almost sounds like a mis-match between 32 and 64 bit libraries....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Mike Stroyan
Honored Contributor

Re: compiling shared libraries question

It is definitely complaining about trying to load a 32-bit shared library from a 64-bit program.
You need to compile the files for the shared library with a "+DD64" or "+DA2.0W" option to create 64-bit code.