develooper Front page | perl.perl5.porters | Postings from March 2000

[ID 20000331.017] Problem on SOlaris with dynamic and static libaries

Thread Next
Bruce Barnett
March 31, 2000 10:55
[ID 20000331.017] Problem on SOlaris with dynamic and static libaries
Message ID:

Here is a minor problem with compiling perl 5.6.0 on Solaris 2.6.

I built a fairly standard perl, wity the following variations

		Sun Pro CC
		Dynamic libraries
		prefix of /local

		I added the flag -L/local where it said so, and asked it to
search /local/lib.

Now - I had /local/lib/libdb.a - not a .so file. The software I build
must have used static loading. I did NOT have there.

Perl auto-determines the libraries to use on the build line. However,
it added -ldb to the list. It got to the point where it tested the
linking and failed. See below.
I had to remove the -ldb from the link line.
It seems to me that if you are building perl with a shared
file, then it should know it can't use static libraries.

--- exact error below -----

Your C linker may need flags.  For this question you should
include -L/whatever and any other flags used by the C linker, but you
should NOT include libraries like -lwhatever.

Make sure you include the appropriate -L/path flags if your C linker
does not normally search all of the directories you specified above,
	/local/lib /lib /usr/lib /usr/ccs/lib
To use no flags, specify the word "none".

Any additional ld flags (NOT including libraries)? [none] -L/local
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:

#include <stdio.h>
int main() { printf("Ok\n"); exit(0); }

I used the command:

	cc -O -D_REENTRANT -o try -L/local try.c -lsocket -lnsl -ldb -ldl -lm -lposix4 -lpthread -lc -lcrypt -lsec

and I got the following output:

ld: fatal: library -ldb: not found
ld: fatal: File processing errors. No output written to try
I can't compile the test program.
(The supplied flags or libraries might be incorrect.)
You have a BIG problem.  Shall I abort Configure [y] 
Ok.  Stopping Configure.
script done on Fri Mar 31 11:22:19 2000

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About