前言
编译一个cm时,用到了boost, 先试了boost_1_34_1, vc6编译不过去, 明显语法不支持.
下载了最新的boost版本boost_1_63_0, 用vs2013编译.
进入vs2013命令行, 进入D:\boost_1_63_0, 执行bootstrap.bat
再执行.\b2
编译后,连接进cm工程, 设置包含路径和库路径.
包含路径 : D:\boost_1_63_0
库路径 : D:\boost_1_63_0\stage\lib
编译cm工程, 提示LINK : fatal error LNK1104: cannot open file ‘libboost_filesystem-vc120-mt-sgd-1_63.lib’.
查到一份资料, 说明如何编译-sgd-.lib.
写了一个脚本来编译.
记录
echo off
rem @filename : myB2.bat
rem LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc120-mt-sgd-1_63.lib'
rem You'd need to have runtime-link=static runtime-debugging=on variant=debug in the b2 command line args to get sgd.
rem Key | Use this library when: | Boost.Build option
rem =====================================================================================
rem s | linking statically to the C++ standard library and | runtime-link=static
rem | compiler runtime support libraries. |
rem -------------------------------------------------------------------------------------
rem g | using debug versions of the standard and runtime | runtime-debugging=on
rem | support libraries. |
rem -------------------------------------------------------------------------------------
rem y | using a special debug build of Python. | python-debugging=on
rem -------------------------------------------------------------------------------------
rem d | building a debug version of your code. | variant=debug
rem -------------------------------------------------------------------------------------
rem p | using the STLPort standard library rather than the | stdlib=stlport
rem | default one supplied with your compiler. |
rem build libboost_filesystem-vc120-mt-sgd-1_63.lib
.\b2 runtime-link=static runtime-debugging=on variant=debug
echo on
运行myB2.bat, 编译成功后, 有了libboost_filesystem-vc120-mt-sgd-1_63.lib.
再编译cm工程,编译成功了.