简体   繁体   English

使用JsonCpp和Boost链接问题

[英]Linking problems using JsonCpp and Boost

I have a project and I need to work with JsonCpp and boost/thread in VS2010 But I have a problem with linking: 我有一个项目,我需要在VS2010中使用JsonCpp和boost / thread,但是链接存在问题:

  • JsonCpp need to be compiled with runtime lib set to MultiThread (/MT) JsonCpp需要在运行时库设置为MultiThread(/ MT)的情况下进行编译
  • I think I have compiled boost/thread in static, MT because I have: 我想我已经在静态MT中编译了boost / thread,因为我有:
    • libboost_thread-vc100-mt-1_48.lib libboost_thread-vc100-mt-1_48.lib
    • libboost_thread-vc100-mt-s-1_48.lib libboost_thread-vc100-mt-s-1_48.lib

Now, I have the following linking error: 现在,我有以下链接错误:

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; 链接:警告LNK4098:defaultlib'MSVCRT'与其他库的使用发生冲突; use /NODEFAULTLIB:library 使用/ NODEFAULTLIB:library

If I use /NODEFAULTLIB:MSVCRT, I have other linking errors... 如果我使用/ NODEFAULTLIB:MSVCRT,则我还有其他链接错误...

Maybe I didn't compile boost correctly, I used their jam script with: 也许我没有正确编译boost,我将他们的jam脚本用于:

runtime-link=static runtime-link =静态

Thank you :-) 谢谢 :-)

One solution is to just include the JsonCpp source code into your project's source tree. 一种解决方案是仅将JsonCpp源代码包含在项目的源树中。 For all of the disadvantages it may have, it works, and it's simple. 对于它可能具有的所有缺点,它很有效,而且很简单。

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

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