LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc120-mt-sgd-1_63.lib'

前言

编译一个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工程,编译成功了.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值