升压自动链接并非由升压建图书馆,但那些intented内置。 [英] Boost autolinks libraries which are not built by Boost, but the intented ones are built.

查看:191
本文介绍了升压自动链接并非由升压建图书馆,但那些intented内置。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发可以通过编写Python脚本扩展一个数学的应用程序。

I am developing a Math application which can be extended by writing python scripts.

我使用Qt 4.6.3(构建为静态库,调试和发布版本)和升压1.43.0(建成静态库,运行时链接也设置为静态,多线程版本,调试和发布)。一切是建立与MSVC ++ 2008。加速建立以下库:

I am using Qt 4.6.3 (built as static library, debug and release versions) and Boost 1.43.0 (built as static library, runtime-link also set to static, multi-threaded version, debug and release). Everything is built with MSVC++2008. Boost built the following libraries:


  • libboost_python-vc90-MT-S-1_43.lib

  • libboost_python-vc90-MT-s.lib

  • libboost_python-vc90-MT-SGD-1_43.lib

  • libboost_python-vc90-MT-sgd.lib

我的项目编译,但在链接阶段提供了以下错误:

My project compiles, but gives the following error during the linking phase:

1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'boost_python-vc90-mt-gd-1_43.lib'

为什么不选择我的编译库之一吗?

Why is it not selecting one of my compiled libraries?

我觉得在库名称S代表静态的,但随后的自动连接功能,似乎选择了一个动态库,我想这一切在一个可执行静态链接。

I think the s in the library names stands for static, but then the auto-linking feature seems to select a dynamic library, and I want it all linked statically in one executable.

情况与此相同的正则表达式库:我有同样的正则表达式4编译库和一个快速测试显示了此链接错误:

The same happens with the regex library: I have the same 4 regex libraries compiled and a quick test shows this linking error:

1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1_43.lib'

该怎么办?

推荐答案

问题是固定的,Boost库的编译过程中,我选择了链接= static选项。它创建静态库。我也选择了运行时链接= static选项,这是错误的!

The problem is fixed, during the compilation of the boost libraries, I selected the link=static option. Which creates static libraries. I also selected runtime-link=static option, and this was wrong!

有关这个问题的解决方案是用编译运行链接升压=共享。现在,一些额外的库添加,用正确的文件名,所以链接器能够找到它们。起初,编译器仍然搜索(而不是libboost_python-vc90-MT-GD-1_43.lib boost_python-vc90-MT-GD-1_43.lib,),一切自动升压链接到一个静态库,但对于dll库因为Boost.Python的都有不同的自动联动设置,当你提供BOOST_PYTHON_STATIC_LIB,它最终链接到正确的库和它的作品!

The solution for this problem was compiling boost with runtime-link=shared. Now some extra libraries are added, with the correct filenames, so the linker can find them. At first the compiler still searches for the dll library (boost_python-vc90-mt-gd-1_43.lib, instead of libboost_python-vc90-mt-gd-1_43.lib), everything else from boost links automatically to a static library, but because boost.python has a different auto-linkage set up, when you provide BOOST_PYTHON_STATIC_LIB, it finally links to the right library and it works!

这篇关于升压自动链接并非由升压建图书馆,但那些intented内置。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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