[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mingw-cross-env-list] Linking statically
From: |
Daniel Stonier |
Subject: |
Re: [Mingw-cross-env-list] Linking statically |
Date: |
Wed, 26 Jan 2011 22:23:03 +0900 |
On 26 January 2011 21:53, Mark Brand <address@hidden> wrote:
>
>> COMPILE COMMAND:
>>
>>> i686-pc-mingw32-g++ -o dude.exe main.o -llog4cxx
>>
>> This fails with undefined references everywhere. Now if I add in all
>> the underlying static libs, it works.
>>
>>> i686-pc-mingw32-g++ -o dude.exe main.o -llog4cxx -laprutil-1 -lapr-1
>>> -lexpat -liconv -lrpcrt4 -lshell32 -lws2_32 -ladvapi32 -lkernel32 -lmsvcrt
>>
>> No problem. My question is, wasn't libtool supposed to use the .la
>> files to automatically find and reference these underlying libs? Is
>> there a syntax to get it to do so?
>
> I'm not a libtool expert, but don't you have to invoke libtool if you want
> to use it? I'm looking at
>
> http://www.gnu.org/software/libtool/manual/html_node/Linking-executables.html#Linking-executables
Yes, looks like it. I learned how to use it by hand for the first time
today and it does indeed resolve the problem linkages by referring to
the .la file. I thought gcc might have passed control onto libtool in
these kinds of situations much as in the way it does when it passes
control to ld. But I can't find any mechanisms which trigger that
behaviour, so I'm guessing you have to call libtool directly.
I know autotools has support for using libtool, has anyone experience
doing this with cmake though? In fact, does anyone have any experience
with cmake and mingw_cross in general?
I'm also a bit curious as to why mingw cross-compiling toolchains
always use static archives instead of shared libraries?
Regards,
Daniel