如何创建一个简单的项目,该项目将使用为 VC 静态链接的 boost 编译(类似于 C:/boost)?我的项目文件应该是什么样子的?
我试图添加到 .pro
INCLUDEPATH += C:/BOOST/include/boost-1_49
DEPENDPATH += C:/BOOST/lib
LIBS += -LC:/BOOST/lib -llibboost_system-vc100-mt-sgd-1_49 -llibboost_thread-vc100-mt-sgd-1_49
但我得到:
msvcprtd.lib(MSVCP100D.dll):-1: ERROR: LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in libboost_system-vc100-mt-sgd-1_49.lib(error_code.obj)
msvcprtd.lib(MSVCP100D.dll):-1: ERROR: LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12@std@@QAE@XZ) already defined in libboost_system-vc100-mt-sgd-1_49.lib(error_code.obj)
msvcprtd.lib(MSVCP100D.dll):-1: ERROR: LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) already defined in libboost_system-vc100-mt-sgd-1_49.lib(error_code.obj)
:-1: WARNING: LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
debug\loader.exe:-1: ERROR: LNK1169: one or more multiply defined symbols found
当我尝试编译类似的东西时:
#include <QtGui/QApplication>
#include <iostream>
#include <boost/filesystem.hpp>
int main(int argc, char *argv[])
{
boost::filesystem::path p;
}
所以我想知道如何更改我的 .proo 文件以正确链接到使用 VS 编译器的 Qt Creator 为 VC 编译的静态 boost?