[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Linking C++ DLLs ...
From: |
David Snopek |
Subject: |
Linking C++ DLLs ... |
Date: |
Sat, 27 Apr 2002 11:40:15 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801 |
Alright, I have another weird libtool bug for you guys. I am
cross-compiling (from linux) a C++ library with mingw using libtool
version 1.4.2 along with autoconf and automake. At the linking stage,
the libtool command is properly generated using $CXXLD as the linker so
that libstdc++ is linked implicitly. It looks something like:
libtool --mode=link i386-mingw32msvc-g++ ...etc...
But the actual linking command uses i386-mingw32msvc-gcc and is unable
to build the DLL because libstdc++ is not linked. I have traced this to
the value of archive_expsym_cmds which uses $CC for the compile command.
Since CC is set to the C compiler we have a problem. I can't use
-lstdc++ explicitly because libtool will refuse to link a static archive
into a DLL (and rightfully so!).
My temporary solution was to copy libtool.m4 into acinclude.m4 and
change lines 1359 to 1363 from $CC to $nonopt. I can't implement a real
fix since I don't understand the overall design of libtool very well
(thats what you guys are for! :-). But CC needs to changed to the value
of nonopt at the beginning of the linking stage accross all platforms,
because I am sure that others are affected as well. Not to mention that
other languages have specific libraries that need to be implicitly linked.
-- David Snopek
/-- libksd --
| The C++ Cross-Platform Game Framework
| Only want to write it once??
| http://libksd.sourceforge.net
\------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Linking C++ DLLs ...,
David Snopek <=