[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

please help with shared libs


I am trying to pack libvdk. Evrithing is now fine, excepting the
dependencies. Aka, the dependencies are wrong: the libvdk is using the
libglib and libgtk. But they are not reflected in the generated deb
files. This made me discover that libvdk itself doesn't contain the
references. This is the output of ldd run over libvdk:

borco-ei:/usr/local/src/vdk/VDK-0.5.0/lib# ldd ./libvdk.so.0.5.0
        libwcsmbs.so.0 => /lib/libwcsmbs.so.0 (0x40064000)
        libstdc++-libc6.0-1.so.2 => /usr/lib/libstdc++-libc6.0-1.so.2
        libm.so.6 => /lib/libm.so.6 (0x400ad000)
        libc.so.6 => /lib/libc.so.6 (0x400c6000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000)

The Makefile(stripped a bit) is added at the end of the message.

Also, the lib doesn't compile without -O2. I get this:

g++ -c -Wall -fPIC  -I../include `gtk-config --cflags` -o vdkclist.o
vdkclist.cc: g++: Internal compiler error: program cc1plus got fatal
signal 11

It compiles well with -O2.

The Makefile seems to give commands like the ones from ELF HOWTO. I have
no previous experience with shared, so it can be also wrong (or
partially wrong). But the idea is that ldd doesn't repport correct the
dependencies. My gcc/g++ are:

bash-2.01$ g++ -v
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
bash-2.01$ gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/
gcc version

The libs has only .cc files, therefore gcc should never be called.



===================== Shorted Makefile ==================

CC      =       g++
C       =       gcc
CFLAGS  =       -Wall -fPIC -O2 #-g -DVDKDEBUG
INCPATH =       -I../include `gtk-config --cflags`
LINK    =       g++
LFLAGS  =       -shared -Wl,-soname,libvdk.so.0
AR      =       ar cqs
####### Files

HEADERS =       application.h \
SOURCES =       application.cc \

OBJECTS =       application.o \

TARGET  =       libvdk.so.0.5.0
TARGETA =       ../lib/libvdk.a
TARGETD =       libvdk.so.0.5.0
TARGET0 =       libvdk.so
TARGET1 =       libvdk.so.0

####### Implicit rules

.SUFFIXES: .cc .c

        $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

        $(C) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules

all: ../lib/libvdk.so.0.5.0

../lib/libvdk.so.0.5.0: $(OBJECTS)
        -rm -f $(TARGET) $(TARGET0) $(TARGET1)
        $(LINK) $(LFLAGS) -o $(TARGETD) $(OBJECTS)
        -ln -s $(TARGET) $(TARGET0)
        -rm -f ../lib/$(TARGET)
        -rm -f ../lib/$(TARGET0)
        -rm -f ../lib/$(TARGET1)
        -mv $(TARGET) $(TARGET0) $(TARGET1) ../lib/

staticlib: $(TARGETA)

        -rm -f $(TARGETA)
        $(AR) $(TARGETA) $(OBJECTS)

        install -d /usr/local/lib/
        install ../lib/$(TARGETA) /usr/local/lib
        install ../lib/$(TARGET) /usr/local/lib/
        install -d /usr/local/include/vdk
        cp ../include/vdk/*.h  /usr/local/include/vdk
        mv ../lib/$(TARGET0) ../lib/$(TARGET1) /usr/local/lib/
        ldconfig /usr/local/lib/

Reply to: