News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to link with platform dependent libraries (Different name)?

Started by lirong, May 28, 2007, 04:48:12 AM

Previous topic - Next topic

lirong

Hi,
I need to link my application with boost c++ libraries.  On Linux, I need to add "boost_date_time.a", but on Windows, it is some thing like this "boost_date_time-mgw-mt-d-1_33_1.lib".  How can I solve this problem?

TIA

kelo81

Hi, you may create two different targets for the same project, something like "Win32" and "linux", and then you may add the libs to each target.
Ezequiel Ruiz
Tango/04 consultant
www.tango04.com

Deschamps

You can also build your boost libraries (see documentation) with the --layout=system parameter for a generic naming without versions nor compilers "build info", so you'll have the same names in Linux or Windows platforms. For instance:

C:\Devtools\boost_1_34_0\libs\date_time\build>bjam --toolset=gcc release --without-python --layout=system
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
...patience...
...found 436 targets...
...updating 4 targets...
gcc.compile.c++ ..\..\..\bin.v2\libs\date_time\build\gcc-mingw-3.4.5\release\greg_month.o
gcc.compile.c++ ..\..\..\bin.v2\libs\date_time\build\gcc-mingw-3.4.5\release\greg_weekday.o
gcc.compile.c++ ..\..\..\bin.v2\libs\date_time\build\gcc-mingw-3.4.5\release\date_generators.o
gcc.link.dll ..\..\..\bin.v2\libs\date_time\build\gcc-mingw-3.4.5\release\boost_date_time.a ..\..\..\bin.v2 \libs\date_time\build\gcc-mingw-3.4.5\release\boost_date_time.dll
Creating library file: ..\..\..\bin.v2\libs\date_time\build\gcc-mingw-3.4.5\release\boost_date_time.a
...updated 4 targets...

C:\Devtools\boost_1_34_0\libs\date_time\build>


Those who were seen dancing were thought to be insane by those who could not hear the music