Mailinglist Archive: opensuse (882 mails)

< Previous Next >
[opensuse] 11.2, libtool, g++ and dynamic libraries
  • From: Peter Suetterlin <P.Suetterlin@xxxxxxxxxxxx>
  • Date: Tue, 21 Dec 2010 12:56:11 +0100
  • Message-id: <20101221115611.GB2413@xxxxxxxxxxxxxxxxxx>

Hi list,

we're having a weird problem here. We want to compile a dynamic library for
an image processing program (IDL) which is written in C++.

There is a makefile that uses libtool to compile with proper switches:

libtool --mode=compile --tag=CXX $(CXX) $(CFLAGS) -o <name>.lo -c <name>.cpp
libtool --mode=link --tag=CXX $(CXX) -o libmomfbd.la <names>.lo -rpath
$(DLM_PATH)

Now this works on a Slackware computer, it creates the dynamic library as
.libs/libmomfbd.so.0.0.0

On OpenSuse it doesn't :-((
Some observations:
I can replace --tag=CXX with --tag=CC. Then it actually compiles, but the
library misses symbols and doesn't load.

Compiling with tag CXX does not add the flags -fPIC -DPIC to the compiler
options. (the Slackware libtool, which is 2.2.6b compared to 2.2.6 in OS,
does add those.)

So to get a library, I have to

- compile with --tag=CXX
- manually add the -fPIC -DPIC flags
- use the informational output from 'libtool --mode=link --tag=CC ...' (which
will call gcc), replace gcc with g++ and link by hand

This is ugly, and cannot be intended. But as I'm no programmer, I might have
done things wrong. So my question is:


Is something wrong in this setup (which works on another machine),
or is libtool with g++ broken in OS 11.2

Cheers,

Pit

PS: Update: I just saw that OS 11.3 uses libtool 2.2.6b, so I installed that
(plus libltdl7) for a test. Same result - no lib, and also the PIC flags
are still not there. So libtool in OS is different from the same version
in Slackware?

--
Dr. Peter "Pit" Suetterlin http://www.astro.su.se/~pit
Institute for Solar Physics
Tel.: +34 922 405 590 (Spain) P.Suetterlin@xxxxxxxxxxxx
+46 8 5537 8507 (Sweden) Peter.Suetterlin@xxxxxxxxxxx
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups