how to solve the problem lnk error
-
libboost\x86_32_msv\boost_locale-vc141-mt-x32-1_84.dll : fatal error LNK1107: the file is invalid or broken.could not read at 0x2C0
I used the msv 2017 and qt 5.14.1 for compiling the program.
and the program based on the boost libs.
unfortunatly i compiled successfully once time.but after that.the program always occured the errors.here s the detail information:
1.libboost depends on x86 address-model=32 link=shared runtime-link=shared threading=multi.
in fact,not only the boost libs is the problem.other libs is the same tips.such as the libssl .i dont know why. maybe is it related to the compile args?
LIBS += lib/libopenssl/libssl-3.dll
LIBS += lib/libopenssl/libcrypto-3.dll
LIBS +=lib/libboost/boost_url-vc141-mt-x32-1_84.dll
2.here 's the qt kits settings
3. here's the pro settings.
QT += core
TEMPLATE = lib
CONFIG += c++17 dll -
libboost\x86_32_msv\boost_locale-vc141-mt-x32-1_84.dll : fatal error LNK1107: the file is invalid or broken.could not read at 0x2C0
I used the msv 2017 and qt 5.14.1 for compiling the program.
and the program based on the boost libs.
unfortunatly i compiled successfully once time.but after that.the program always occured the errors.here s the detail information:
1.libboost depends on x86 address-model=32 link=shared runtime-link=shared threading=multi.
in fact,not only the boost libs is the problem.other libs is the same tips.such as the libssl .i dont know why. maybe is it related to the compile args?
LIBS += lib/libopenssl/libssl-3.dll
LIBS += lib/libopenssl/libcrypto-3.dll
LIBS +=lib/libboost/boost_url-vc141-mt-x32-1_84.dll
2.here 's the qt kits settings
3. here's the pro settings.
QT += core
TEMPLATE = lib
CONFIG += c++17 dll@nicker-player said in how to solve the problem lnk error:
libboost\x86_32_msv\boost_locale-vc141-mt-x32-1_84.dll : fatal error LNK1107: the file is invalid or broken.could not read at 0x2C0
Did you try to reinstall Boost?
Are you sure you're using x86 and not x86_64 Kit to build? -
yeah ,i used the x86 platform of the compile tools and libs.I just wondered if is it nessary that the dll file needed the lib module?
-
You can not link directly against a DLL, you need the static import lib. But that's nothing Qt or boost specific.
-
You can not link directly against a DLL, you need the static import lib. But that's nothing Qt or boost specific.
@Christian-Ehrlicher @nicker-player Forgot about it.
@nicker-player yes, you need to add *.lib to LIBS, not *.dll.
*.lib - needed for linking
*.dll - needed at runtime -
someone told me that the c++ class dlls which the mingw compiled could not be used by the vs compiling tools,is it true?
or is it possible that if I used the vs dumpbin and lib.exe to export the libs from the dlls,so that the vs compiling tools could recognize the dlls? -
You can not mix c++ libraries compile for MinGW and MSVC.