For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2007 > gcc compiling perl on solaris









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author gcc compiling perl on solaris
Jrpfinch

2007-08-07, 7:00 pm

Not strictly a perl question, but on the off-chance someone else has
come across this problem...

I am trying to compile perl 5.8.8 on Intel Solaris 10 with the gcc
that comes with the base install. When I run Configure Dcc=gcc and
select all the defaults, I get the following problem:

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"); return(0); }

I used the command:

gcc -o try -O -fno-strict-aliasing -pipe -Wdeclaration-after-
statement try.c -lsocket -lnsl -ldb -ldl -lm -lc
./try

and I got the following output:

ld: fatal: library -ldb: not found
ld: fatal: File processing errors. No output written to try
collect2: ld returned 1 exit status
I can't compile the test program.
(The supplied flags or libraries might be incorrect.)

--------------------------------------------------------------------------------------------

I've googled around but have yet to find what -ldb does or what it
looks for. There doesn't seem to be a man gcc. I'll carry on
looking, but if anyone knows and could speed up my search, I would be
grateful.

I have read README.solaris and have followed all the instructions
there including trying Configure -Dcc='gcc -B/usr/ccs/bin/'. This
doesn't make any difference.

Many thanks

Jon

Tom Phoenix

2007-08-07, 7:00 pm

On 8/7/07, jrpfinch <jrpfinch@gmail.com> wrote:

> I've googled around but have yet to find what -ldb does or what it
> looks for. There doesn't seem to be a man gcc.


You need to have google-fu to search for things like -ldb. (The
leading hyphen is meaningful to Google.) But I found this page for
you, and it should lead you to the rest of "man gcc" once you've seen
what it says about -l.

http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Have fun with it!

--Tom Phoenix
Stonehenge Perl Training
Jeff Eggen

2007-08-07, 7:00 pm

>>> jrpfinch <jrpfinch@gmail.com> 8/7/2007 8:28 AM >>>
>I am trying to compile perl 5.8.8 on Intel Solaris 10 with the gcc
>that comes with the base install. When I run Configure Dcc=3Dgcc and
>select all the defaults, I get the following problem:


[snip]

>and I got the following output:


>ld: fatal: library -ldb: not found


I just tripped across this a couple of ws ago. For me, it was because =
there's no symlink for libdb.so.1 in /usr/lib called libdb.so. The =
Configure script determines that -ldb should be available one way, but the =
compiler / linker uses another method to actually load the library. I =
created the symlink, and everything worked okay after that.

Hope this helps,

Jeff Eggen
IT Analyst
Saskatchewan Government Insurance
Ph (306) 751-1795
email jeggen@sgi.sk.ca

This e-mail and any files transmitted with it are confidential and =
intended solely for the use of the individual or entity to whom they are =
addressed. If you are not the named addressee, please notify the sender =
immediately by e-mail if you have received this e-mail by mistake and =
delete this e-mail from your system. If you are not the intended recipient =
you are notified that using, disclosing, copying or distributing the =
contents of this information is strictly prohibited.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com