Boost logo

Boost Users :

From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-07-12 04:45:59


John Femiani wrote:

> Volodya wrote:
>> > There is a problem, because -lboost_xyz links with the dll import
>> > library boost_xyz.lib instead of libboost_xyz.lib. Sure, there is a
>> > way around it, but it requires an extra change to build on
>> windows. It
>> > is a headache and I wish boost would compile the mingw
>> libraries with
>> > a .a extension.
>>
>> Can you clarify what exact naming scheme you want? Say, what
>> should be the names for dynamic library, static library, and
>> import library for boost_xyz?
>>
>
> I think everything would work if static libraries made with mingw and
> kin used .a as the extension instead of .lib.
>
> For example:
>
> boost_xyz.dll -- dynamic library
> boost_xyz.lib -- import library
> libboost_xyz.a -- static library
>
> The mingw compiler seems to prefer libboost_xyz.a over boost_xyz.lib, so
> it chooses the correct one.

What is the correct one, and why is it correct? In other words, how to I link
to a dynamic library?

>> > Another option would be if static libraries would not
>> include the 'lib'
>> > prefix on windows so that the mingw linker did not get
>> confused. (This
>> > means the dll import library filenames would need different stems)
>>
>> Hmm, I'm not sure I like this option.
>>
>
> Well, the current convention uses the presence or absence of a prefix
> that has another meaning to some tools.
>
> Anyhow, I prefer the first option: rename lib<name>.lib to lib<name>.a

It is my understanding that the distinguishing property of mingw is that it is native
windows compiler, as opposed to cygwin, which is compiler for a bizarre operating system
technically called GNU/kernel32.dll. Since mingw is a native compiler
(and uses MSVC runtime, even), it makes sense for it to interoperate with MSVC. And the
current naming exactly matches the naming of libraries in MSVC.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net