How to compile statically?
Hi there,
I've been trying to statically link streamdvd against libdvdread-0.9.4, without success so far. Is there anyone with experience in that domain who could lend me a hand?
First, I have modified streamdvd make file so the compilation uses libdvdread-0.9.4.
gcc -g -Wall -I../libdvdread-0.9.4/ -c requant.c streamdvd.c
gcc -g -Wall -I../libdvdread-0.9.4/ -L../libdvdread-0.9.4/dvdread/.libs/ -ldvdread -lm -o streamdvd streamdvd.o requant.o
No problem so far, but that'll use shared libraries. This is not what I want. I googled around and one suggestion was to move libdvd *.so files away to force use of *.a library. That didn't work. I also tried adding the static keyword on the second line. That does not work either. In both cases I have the linker complaining about undefined symbols. It is like the linker does not see the static libraries.
Here's the output I get when compiling with the "static" keyword.
gcc -g -Wall -I../libdvdread-0.9.4/ -c requant.c streamdvd.c
streamdvd.c: In function ‘stream_vob’:
streamdvd.c:107: warning: pointer targets in passing argument 1 of ‘identify_stream’ differ in signedness
gcc -v -g -Wall -I../libdvdread-0.9.4/ -L../libdvdread-0.9.4/dvdread/.libs/ -ldvdread -lm -o streamdvd streamdvd.o requant.o
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux
Thread model: posix
gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)
/usr/libexec/gcc/i386-redhat-linux/4.0.2/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o streamdvd /usr/lib/gcc/i386-redhat-linux/4.0.2/../../../crt1.o /usr/lib/gcc/i386-redhat-linux/4.0.2/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.0.2/crtbegin.o -L../libdvdread-0.9.4/dvdread/.libs/ -L/usr/lib/gcc/i386-redhat-linux/4.0.2 -L/usr/lib/gcc/i386-redhat-linux/4.0.2 -L/usr/lib/gcc/i386-redhat-linux/4.0.2/../../.. -ldvdread -lm streamdvd.o requant.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i386-redhat-linux/4.0.2/crtend.o /usr/lib/gcc/i386-redhat-linux/4.0.2/../../../crtn.o
streamdvd.o(.text+0x156): In function `stream_vob':
/phil/src/stream/StreamDVD-0.3/streamdvd.c:93: undefined reference to `DVDOpenFile'
|