小编wes*_*wes的帖子

无法在MT模式下编译简单的Qt程序,而不是Visual Studio 2010中的MD

我正在尝试使用Visual Studio 2010中的MTd而不是MDd进行编译(因此dll是打包的,我不需要用我的exe分发它们),但我不断得到"致命错误LNK1169:一个或多个乘法在编译期间找到的已定义符号.MDD编译正常但在其他计算机上没有MSVCP100.dll时无法正常工作.

我正在使用Qt的静态构建,我正在尝试构建VS加载项附带的默认Qt程序.

是否有另一种强制链接器静态编译的方法?我所要做的就是将Qt程序作为exe发布而不用dll.

这是构建日志:

1>ClCompile:
1>  All outputs are up-to-date.
1>  cooltest1.cpp
1>  moc_cooltest1.cpp
1>  main.cpp
1>  Generating Code...
1>  All outputs are up-to-date.
1>  qrc_cooltest1.cpp
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in …
Run Code Online (Sandbox Code Playgroud)

c++ winapi qt visual-studio-2010 static-linking

11
推荐指数
2
解决办法
1万
查看次数

标签 统计

c++ ×1

qt ×1

static-linking ×1

visual-studio-2010 ×1

winapi ×1