Tôi đang cố gắng biên dịch bằng MTd trong Visual Studio 2010 thay vì MDd (để dll được đóng gói và tôi sẽ không cần phải phân phối chúng với exe của tôi), nhưng tôi tiếp tục nhận được "lỗi nghiêm trọng LNK1169: một hoặc nhiều ký tự được xác định nhân được tìm thấy" trong quá trình biên dịch. MDd biên dịch tốt nhưng không hoạt động mà không có MSVCP100.dll trên các máy tính khác.Không thể biên dịch chương trình Qt đơn giản trong chế độ MT trái ngược với MD trong Visual Studio 2010
Tôi đang sử dụng bản dựng Qt tĩnh và tôi đang cố gắng tạo chương trình Qt mặc định đi kèm với trình bổ sung VS.
Có cách nào khác để buộc trình liên kết biên dịch tĩnh không? Tất cả tôi đang cố gắng làm là phân phối một chương trình Qt như một exe mà không có dll.
Đây là build log:
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 &)" ([email protected]@@[email protected]@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" ([email protected]@@[email protected]) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" ([email protected]@@[email protected]@@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMT.lib(memmove.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strncmp already defined in LIBCMT.lib(strncmp.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isupper already defined in LIBCMT.lib(_ctype.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isalpha already defined in LIBCMT.lib(_ctype.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isdigit already defined in LIBCMT.lib(_ctype.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isspace already defined in LIBCMT.lib(_ctype.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __control87 already defined in LIBCMT.lib(_ieee87_.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __clearfp already defined in LIBCMT.lib(_ieee87_.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strncpy_s already defined in LIBCMT.lib(strncpy_s.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strcpy_s already defined in LIBCMT.lib(strcpy_s.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &,int)" ([email protected]@@[email protected]@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __errno already defined in LIBCMT.lib(dosmap.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _abort already defined in LIBCMT.lib(abort.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>c:\users\username\documents\visual studio 2010\Projects\CoolTest1\\CoolTest1.exe : fatal error LNK1169: one or more multiply defined symbols found
1>
1>Build FAILED.
tôi đã làm điều đó một vài năm trước đây, nhưng cuối cùng tôi quyết định đó không phải là giá trị rắc rối. Những người Qt muốn bạn xây dựng năng động, vì vậy cuộc sống của bạn sẽ dễ dàng hơn nếu bạn làm theo cách đó. – user763305