Saturday, December 15, 2012

Building on Windoze with boost

Just recently I tried to build an app on Windoze that uses boost. I got an error at linktime to do with a missing symbol from boost. It was for system_category() in the boost system library. I eventually tracked down the cause, which is very non-obvious. It is to do with 32 bit versus 64 bit building. I am using Windoze 7, 64 bit. The problem was caused by the way I was using jam to do the boost build. The command line to use is:

bjam toolset=msvc-10.0 variant=release threading=multi link=static
--address-model=64 --build-type=complete --with-system

In particular, note that
you must say --address-model=64. the -- is very important. Some other reports of this issue on the web say that you have to say address-model=64.