Boost logo

Boost Users :

Subject: Re: [Boost-users] 64 bit Project
From: Michael Jackson (mike.jackson_at_[hidden])
Date: 2010-04-28 09:40:41


On 4/28/10 6:28 AM, in article
l2t47e5f0471004280328nc0901912rd168d0daba2ac888_at_[hidden], "Christoph
Rabel" wrote:

> Hi!
>
> I am trying to build a project here with Visual Studio 2008 for a 64
> bit platform, but I get a lot errors like the following (building it
> 32 bit works fine)
>
> 1>boosttest.obj : error LNK2001: unresolved external symbol "private:
> class boost::basic_regex<char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > > & __cdecl
> boost::basic_regex<char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > >::do_assign(char const *,char const
> *,unsigned int)"
> (?do_assign@?$basic_regex_at_DU?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boos
> t@@@boost@@AEAAAEAV12_at_PEBD0I@Z)
>
> Here is what I did to build the libs:
>
> bjam msvc architecture=x86 address-model=64 stage
> bjam msvc architecture=x86 address-model=64 install
>
> I tried various versions of the above lines, with other parameters, or
> written differently e.g. (--toolset=msvc) but the end result did not
> change.
>
> Then I added the c:\boost\include\... and c:\boost\lib dir to (Tools
> -> Options -> VC++ Directories -> Platform x64 Include and Library
> files)
> To simplify the problem I created a new project and created a new
> Configuration for x64
>
> -----
> #include "stdafx.h"
> #define BOOST_LIB_DIAGNOSTIC
> #include <boost/regex.hpp>
> #include <string>
>
> int main()
> {
> boost::regex pat( "bla" );
> }
> -----
>
> I can build above fine in 32 bit mode, using the same(!) lib folder.
> So I assume, the created libs are 32 bit. (Can I check that somehow?)
> Any ideas what I might do wrong? Or what I might do to find out where
> the problem lies?
>
> Thanks, Christoph

Did you build boost from a "64 Bit" Command Prompt? Using the normal "Visual
Studio Command Prompt" sets up for 32 bit compiles. Using the "Visual Studio
64 bit COmmand Prompt will compile 64 bit binaries. This is how I usually do
it and it works just fine.

Mike Jackson


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