Hello,
I'm trying to cross-build a library using autotools and libtool (build=x86_64-unknown-linux-gnu and host=i686-pc-mingw32).
I'm having problems with libtool complaining about undefined symbols and refusing to build a shared version of the library.
Code:
/bin/bash ../libtool --tag=CXX --mode=link i686-pc-mingw32-g++ -g -O2 -g -O2 -no-undefined -o libconvolver.la -rpath /usr/local/lib libconvolver_la-convolver.lo libconvolver_la-convolver_ui.lo ../vstsdk2.4/public.sdk/source/vst2.x/.libs/libVst24.a -L/home/dax/armus/toolchain/i686-mingw/build/i686-pc-mingw32//lib -mthreads -Wl,--subsystem,windows -mwindows /home/dax/armus/toolchain/i686-mingw/build/i686-pc-mingw32//lib/libwx_mswd-2.8-i686-pc-mingw32.a -lwxregexd-2.8-i686-pc-mingw32 -lwxexpatd-2.8-i686-pc-mingw32 -lwxtiffd-2.8-i686-pc-mingw32 -lwxjpegd-2.8-i686-pc-mingw32 -lwxpngd-2.8-i686-pc-mingw32 -lwxzlibd-2.8-i686-pc-mingw32 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32
*** Warning: Trying to link with static lib archive ../vstsdk2.4/public.sdk/source/vst2.x/.libs/libVst24.a.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because the file extensions .a of this argument makes me believe
*** that it is just a static archive that I should not use here.
*** Warning: Trying to link with static lib archive /home/dax/armus/toolchain/i686-mingw/build/i686-pc-mingw32//lib/libwx_mswd-2.8-i686-pc-mingw32.a.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because the file extensions .a of this argument makes me believe
*** that it is just a static archive that I should not use here.
*** Warning: linker path does not have real file for library -lwxregexd-2.8-i686-pc-mingw32.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libwxregexd-2.8-i686-pc-mingw32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/dax/armus/toolchain/i686-mingw/build/bin/../lib/gcc/i686-pc-mingw32/4.3.0/../../../../i686-pc-mingw32/lib//libwxregexd-2.8-i686-pc-mingw32.a
*** Warning: linker path does not have real file for library -lwxexpatd-2.8-i686-pc-mingw32.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libwxexpatd-2.8-i686-pc-mingw32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/dax/armus/toolchain/i686-mingw/build/bin/../lib/gcc/i686-pc-mingw32/4.3.0/../../../../i686-pc-mingw32/lib//libwxexpatd-2.8-i686-pc-mingw32.a
*** Warning: linker path does not have real file for library -lwxtiffd-2.8-i686-pc-mingw32.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libwxtiffd-2.8-i686-pc-mingw32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/dax/armus/toolchain/i686-mingw/build/bin/../lib/gcc/i686-pc-mingw32/4.3.0/../../../../i686-pc-mingw32/lib//libwxtiffd-2.8-i686-pc-mingw32.a
*** Warning: linker path does not have real file for library -lwxjpegd-2.8-i686-pc-mingw32.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libwxjpegd-2.8-i686-pc-mingw32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/dax/armus/toolchain/i686-mingw/build/bin/../lib/gcc/i686-pc-mingw32/4.3.0/../../../../i686-pc-mingw32/lib//libwxjpegd-2.8-i686-pc-mingw32.a
*** Warning: linker path does not have real file for library -lwxpngd-2.8-i686-pc-mingw32.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libwxpngd-2.8-i686-pc-mingw32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/dax/armus/toolchain/i686-mingw/build/bin/../lib/gcc/i686-pc-mingw32/4.3.0/../../../../i686-pc-mingw32/lib//libwxpngd-2.8-i686-pc-mingw32.a
*** Warning: linker path does not have real file for library -lwxzlibd-2.8-i686-pc-mingw32.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libwxzlibd-2.8-i686-pc-mingw32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/dax/armus/toolchain/i686-mingw/build/bin/../lib/gcc/i686-pc-mingw32/4.3.0/../../../../i686-pc-mingw32/lib//libwxzlibd-2.8-i686-pc-mingw32.a
*** Warning: linker path does not have real file for library -luuid.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libuuid and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/dax/armus/toolchain/i686-mingw/build/bin/../lib/gcc/i686-pc-mingw32/4.3.0/../../../../i686-pc-mingw32/lib//libuuid.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.
*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
libtool: link: i686-pc-mingw32-ar cru .libs/libconvolver.a .libs/libconvolver_la-convolver.o .libs/libconvolver_la-convolver_ui.o
libtool: link: i686-pc-mingw32-ranlib .libs/libconvolver.a
libtool: link: ( cd ".libs" && rm -f "libconvolver.la" && ln -s "../libconvolver.la" "libconvolver.la" )
I've tried finding those undefined references, but all the ones I'd find they were somewhere in the linked libraries.
The next commands successfully builds the shared library
Code:
i686-pc-mingw32-g++ -shared --no-undefined -g -O2 -g -O2 -o libconvolver.dll .libs/libconvolver_la-convolver.o .libs/libconvolver_la-convolver_ui.o ../vstsdk2.4/public.sdk/source/vst2.x/.libs/libVst24.a -L/home/dax/armus/toolchain/i686-mingw/build/i686-pc-mingw32//lib -mthreads -Wl,--subsystem,windows -mwindows /home/dax/armus/toolchain/i686-mingw/build/i686-pc-mingw32//lib/libwx_mswd-2.8-i686-pc-mingw32.a -lwxregexd-2.8-i686-pc-mingw32 -lwxexpatd-2.8-i686-pc-mingw32 -lwxtiffd-2.8-i686-pc-mingw32 -lwxjpegd-2.8-i686-pc-mingw32 -lwxpngd-2.8-i686-pc-mingw32 -lwxzlibd-2.8-i686-pc-mingw32 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32
I'm quite new to both autotools and libtool. I'd appreciate any help regarding how to fix this or how to find out what symbols are undefined (libtool will not list them)!
Thanks a lot.
Eric