建筑升压动态链接给出链接错误? [英] Building Boost dynamically linkable gives linking error?

查看:288
本文介绍了建筑升压动态链接给出链接错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这里我有:


创建库bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt -on \thrd-mlt\boost_thread-vc110-mt-gd-1_53.lib和对象bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\\ \\async-excpt-on\thrd-mlt \boost_thread-vc110-mt-gd-1_53.exp
thread.obj:error LNK2019:未解析的外部符号__declspec(dllimport)public:__thiscall boost :: gregorian :: greg_month :: greg_month(unsigned short)(_ imp ?? 0greg_month @ gregorian @ boost @@ QAE @ G @ Z)引用函数public:__thiscall boost :: gregorian :: date :: date(enum boost :: date_time :: special_values)(?? 0date @ gregorian @ boost @@ QAE @ W4special_values @ date_time @ 2 @@ Z)
thread.obj:error LNK2019:unresolved external symbol __declspec(dllimport)public:__thiscall boost :: gregorian :: greg_month :: operator unsigned short(void)const(_ imp ?? Bgreg_month @ gregorian @ boost @@ QBEGXZ)function __catch $ ?make_external_thread_data @?A0x9b8c45f0 @ boost @@ YAXXZ $ 0
bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt-on\\ \\ thrd-mlt \boost_thread-vc110-mt-gd-1_53.dll:致命错误LNK1120:2未解决的外部


有关设置的信息:



操作系统:W7 x64



要构建的命令:


b2 -j%NUMBER_OF_PROCESSORS%--abbreviate-paths toolset = msvc-11.0 define = _SECURE_SCL = 0 define = _CRT_SECURE_NO_DEPRECATE define = _CRT_SECURE_NO_WARNINGS --without-mpi address-model = 32 variant = debug install link = shared runtime-link = shared threading = multi asynch-exceptions = on exception-handling = on extern-c-nothrow = off --prefix = .. \boost
cd ..


我已将CYGWin安装到电脑上。



尝试直到现在;



*我试图在32位命令窗口中构建它(我使用jenkins构建提升)

*在boost config / user.hpp中写了#define BOOST_ALL_DYN_LINK



*我在#define BOOST_ALL_NO_LIB boost config / user.hpp



有没有人经历过这样的问题?我真的在任何地方找不到任何东西吗?






EDIT:
$ b

有关于我的问题的更新。我能够建立它的发布。只有我改变的是这里:



b2 -j%NUMBER_OF_PROCESSORS%--abbreviate路径toolset = msvc-11.0 define = _SECURE_SCL = 0 define = _CRT_SECURE_NO_DEPRECATE define = _CRT_SECURE_NO_WARNINGS --without-mpi address-model = 32 variant = release install link = shared runtime-link = shared threading = multi asynch-exceptions = on exception-handling = on extern-c-nothrow = off --prefix = .. \boost
cd ..



这可能是什么问题?

解决方案

如何解决这个问题



<

实际上,我找到了解决方案:



我使用bjam的方式是正确的,足够动态构建提升。在这个阶段,我不应该定义什么。编译之后,我改变user.hpp和#define BOOST_ALL_DYN_LINK。
这种方式我自己的项目(使用boost)将理解boost是动态的。



这似乎是最好的方法,因为boost会按照预期自动解码必要的libs和dll,并且运行良好。


I am trying to build boost and generate dll's but whatever I have done did not solve the problem.

Here what I have got:

Creating library bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt-on\thrd-mlt\boost_thread-vc110-mt-gd-1_53.lib and object bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt-on\thrd-mlt\boost_thread-vc110-mt-gd-1_53.exp thread.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (_imp??0greg_month@gregorian@boost@@QAE@G@Z) referenced in function "public: __thiscall boost::gregorian::date::date(enum boost::date_time::special_values)" (??0date@gregorian@boost@@QAE@W4special_values@date_time@2@@Z) thread.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::operator unsigned short(void)const " (_imp??Bgreg_month@gregorian@boost@@QBEGXZ) referenced in function __catch$?make_external_thread_data@?A0x9b8c45f0@boost@@YAXXZ$0 bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt-on\thrd-mlt\boost_thread-vc110-mt-gd-1_53.dll : fatal error LNK1120: 2 unresolved externals

Here some information about the setup:

OS: W7 x64

Command to build:

b2 -j%NUMBER_OF_PROCESSORS% --abbreviate-paths toolset=msvc-11.0 define=_SECURE_SCL=0 define=_CRT_SECURE_NO_DEPRECATE define=_CRT_SECURE_NO_WARNINGS --without-mpi address-model=32 variant=debug install link=shared runtime-link=shared threading=multi asynch-exceptions=on exception-handling=on extern-c-nothrow=off --prefix=..\boost cd ..

I have CYGWin installed to the computer.

Here what I have tried till now;

*I have tried to build it in 32 bit command window (I am using jenkins to build boost)

*I wrote #define BOOST_ALL_DYN_LINK in the boost config/user.hpp

*I wrote #define BOOST_ALL_NO_LIB in the boost config/user.hpp

Is there anyone who experienced such a problem before? I really could not find anything in anywhere?


EDIT:

There is an update about my problem. I am able to build it for release. Only thing that I have changed is here:

b2 -j%NUMBER_OF_PROCESSORS% --abbreviate-paths toolset=msvc-11.0 define=_SECURE_SCL=0 define=_CRT_SECURE_NO_DEPRECATE define=_CRT_SECURE_NO_WARNINGS --without-mpi address-model=32 variant=release install link=shared runtime-link=shared threading=multi asynch-exceptions=on exception-handling=on extern-c-nothrow=off --prefix=..\boost cd ..

what could be the problem? How can I solve it?

Thanks in advance for any suggestion.

解决方案

Actually I have found the solution:

The way I am using bjam is correct and enough to build boost dynamically. In that stage, I should not define anything. After compilation I change user.hpp and #define BOOST_ALL_DYN_LINK. This way my own projects (which are using boost) will understand boost is dynamic. That is the way how boost should be built.

That seems the best way because boost automatically decode necessary libs and dlls as expected and works well.

这篇关于建筑升压动态链接给出链接错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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