Boost logo

Boost Users :

Subject: Re: [Boost-users] Problems compiling those libraries that are not header only on 64 bit Windows 7
From: Lars Viklund (zao_at_[hidden])
Date: 2011-01-27 05:56:38


On Thu, Jan 27, 2011 at 12:18:17PM +0300, Vladimir Prus wrote:
> Ted Byers wrote:
> > I have two versions of MS VS: MS VS 2005 and MS VS 2010. I guess my first
> > question is, "Will library files produced by MS VS 2005 work with MS VS
> > 2010?" I know that library files compiled by compilers from different
> > sources (gcc vs MSVC) won't work with each other (unless the library was
> > written in C or FORTRAN), but does the same apply to different versions fo
> > the same compiler?

In general, the library format between VS versions is not forward or
backward compatible. This is primarily due to using different runtime
versions, but also due to that the MSIL (not the .NET IL) of .lib files
is not guaranteed to be compatible between versions. Such IL is
generated if you have options like Link-Time Code Generation and other
fancy settings.

As for properly portable libraries, that tends to involve a rather
restricted language subset for the interface and building against a
common runtime, like the one that the DDK compilers targets.

> > I used a prebuilt distribution of bjam for all my attempts to build the
> > boost libraries using msvc++. I did not compile it myself.
>
> Please use the bootstrap.bat script to build bjam from the 1.45 release,
> and then use it.
>
> >
> > bjam --build-dir=C:\boost_1_45_0\lib\msvc2010\x32 --build-type=complete
> >
> > bjam --build-dir=C:\boost_1_45_0\lib\msvc2010\x64 --build-type=complete
>
> I am somewhat confused -- those two commands differ only in --build-dir option,
> therefore they will build boost using the same version of the same compiler.
> If you with to use different versions, specify toolset=msvc-10.0 and toolset=msvc-9.0
> during those invocations. Also, use address-model=64 if you wish to build 64-bit
> libraries. See:

I assume you mean msvc-8.0, as he says he's on 2005. Note that the build
system will completely ignore whether you're in a "Visual Studio 2010
Command Prompt" or in a "Visual Studio 2005 Command Prompt", and will
also ignore the bitness of said command prompt environment.

You need to specify toolset=msvc-x.y and address-model=zz if you want to
target a specific toolset version and bitness.

> You should also use --stagedir=XXX to put the final build products into different directories.
> --build-dir is only for specifying intermediate directory.

Or --prefix=XXX if you're doing an 'install' instead of a 'stage' (stage
is default).

-- 
Lars Viklund | zao_at_[hidden]

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