LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-21-2010, 03:39 PM   #1
dax2112rush
LQ Newbie
 
Registered: Apr 2009
Posts: 7

Rep: Reputation: 0
libtool: problems building a shared library


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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc link shared library against another shared library qcp Linux - Newbie 1 07-25-2008 11:15 AM
libtool: link: cannot find library jrdioko Linux - Software 0 01-13-2006 10:23 PM
Problem installing - libtool: link: cannot find the library `__LIBGL_PATH__/libGL.la' sparX CG Linux - Software 4 11-14-2005 05:45 PM
Problems while using shared library as dll.... rajsun Programming 2 09-10-2005 03:25 AM
Libtool cant find library that exists... Kane635 Linux - Software 0 12-13-2004 06:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration