简体   繁体   English

无法使Boost正确构建

[英]Cannot get Boost to build correctly

I needed to built Boost.Python to work for version 3.2 and I keep running into problems. 我需要构建Boost.Python才能在3.2版上工作,并且一直遇到问题。 I followed the instructions in the Getting Started Guide — both the general instructions and those specifically about Boost.Python — and I can't get it to work. 我遵循了《入门指南》中的说明 ,包括一般说明和专门关于Boost.Python的 说明 ,但我无法使其正常工作。

Here's the program I'm trying to run and the link error I'm getting: 这是我要运行的程序,以及出现的链接错误:

#include <boost/python.hpp>
BOOST_PYTHON_MODULE(test) { }
int main() { return 0; }

1>LINK : fatal error LNK1104: cannot open file 'boost_python-vc100-mt-1_48.lib' 1> LINK:致命错误LNK1104:无法打开文件'boost_python-vc100-mt-1_48.lib'

Indeed, there is no such file, but there is a ' libboost _python-vc100-mt-1_48.lib' file. 确实,没有这样的文件,但是有一个“ libboost _python-vc100-mt-1_48.lib”文件。 (Unsurprisingly, if I try to change its name, it'll give another link error.) (毫不奇怪,如果我尝试更改其名称,它将给出另一个链接错误。)

The command I used to install the libraries was: 我用来安装库的命令是:

C:\...\boost_1_48_0> b2 --build-dir=C:\Boost toolset=msvc --build-type=complete install

And the content of my 'user-config.jam' file in my home directory was: 我主目录中“ user-config.jam”文件的内容为:

using python : 3.2 : C:/Programming/PythonX86/Python32 ;

It looks like you're only building the static boost_python library binary. 看来您只是在构建静态的boost_python库二进制文件。 Have you tried the following command line options for b2? 您是否尝试过b2的以下命令行选项?

link=shared runtime-link=shared

Also, if linking to a static library is acceptable for your needs, adding BOOST_PYTHON_STATIC_LIB to your preprocessor definitions should do the trick... 另外,如果可以接受链接到静态库的需求,那么将BOOST_PYTHON_STATIC_LIB添加到预处理器定义中就可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM