|
|
| The stupid question is the question not asked | |
| PerlMonks |
Inline::C external library linking problemby whakka (Hermit) |
| on Apr 03, 2009 at 23:59 UTC ( #755374=perlquestion: print w/ replies, xml ) | Need Help?? |
|
whakka has asked for the
wisdom of the Perl Monks concerning the following question:
Hi Monks, I need to use libtiff and libgeotiff so I'm embeding C in a Perl program and gluing it together with Inline::C. The C code compiles fine using gcc (version 4.1.2 20080704 (Red Hat 4.1.2-44)) and the normal -l flags (-ltiff -lgeotiff -lm) but I'm having trouble setting up the library linkages when configuring Inline::C. While I'm not entirely sure what's going on, libtiff is located in /usr/lib while libgeotiff was installed by the sysadmin in /usr/local/lib (with header files in /usr/local/include). Everything works fine when I just use libtiff, but when I specify the LIB directive to use libgeotiff also I get the compiler error:
No amount of permutations of these options gives me any better results. The following code illustrates the problem pared down:
Full output:
I really appreciate any assistance, thanks. Update: Thanks to all the very excellent and educational replies, especially almut whose prescient suggestion to replace -L/usr/local/lib -lgeotiff with MYEXTLIB => '/usr/local/lib/libgeotiff.a' did the trick for reasons explained.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||