难道我有静态或动态的Boost库? [英] Do i have static or dynamic boost libraries?

查看:95
本文介绍了难道我有静态或动态的Boost库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经跑 bjam.exe --build-DIR =C:\\集结助推--build型=最小MSVC阶段

和现在我有库的.lib这些标题,例如:

and now I have libraries .lib with these headers, for example

libboost_serialization-vc100-mt
libboost_serialization-vc100-mt-1_45
libboost_serialization-vc100-mt-gd
libboost_serialization-vc100-mt-gd-1_45

我相信这应该是调试和发布版本的静态库。当我运行编译多线程调试(/ MTD)它给出了一个错误 LNK1104:无法打开文件'libboost_serialization-VC100-MT-SGD -1_45.lib这是寻找一个具有 -sgd

I believe these should be static libraries for debug and release version. When I run the compiler with Multi-threaded Debug (/MTd) it gives an error LNK1104: cannot open file 'libboost_serialization-vc100-mt-sgd-1_45.lib' It is looking for one with -sgd

我在哪里去了?

推荐答案

东西是种令人困惑的是,有与MSVC建设推动两个静态的选项。

Something that is kind of confusing is there are two 'static' options for building boost with MSVC.

B2.exe需要的选项链接=静态告诉提振要IT静态链接。如果您正在编译使用/ MT或/ MTD的VC项目,你还需要使用运行时链接=静态选项告诉提升,你将链接到VC运行时库静态。

B2.exe takes the option link=static which tells boost that you want to link IT statically. If you are compiling your VC project with /MT or /MTd you will also need to use the runtime-link=static option to tell boost that you will be linking to the VC runtime libraries statically.

这是第二个运行时链接=静态这使该-s中的.lib名。

It is the second runtime-link=static which puts the -s in the .lib name.

我的命令建筑增压线路是

My command line for building boost was

b2.exe --toolset=msvc variant=release link=static threading=multi runtime-link=static stage

这篇关于难道我有静态或动态的Boost库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆