Link library MSVC
-
My project compiles with MinGW 5.3 and Qt 5.7.0. However, with MSVC 2015 32 bit I get unresolved external symbol for CryptAcquireContextW and RegCloseKey. I found that libraries needed are advapi32 and crypt32.
I don't have to specify these libraries explicitly in *.pro file for MinGW but it seems MSVC needs it. How to modify *.pro file so it compiles for both MinGW and MSVC?
I already tried to add LIBS += -ladvapi32 -lcrypt32 but that doesn't work for MSVC compilation - I still get unresolved external symbols.
-
My project compiles with MinGW 5.3 and Qt 5.7.0. However, with MSVC 2015 32 bit I get unresolved external symbol for CryptAcquireContextW and RegCloseKey. I found that libraries needed are advapi32 and crypt32.
I don't have to specify these libraries explicitly in *.pro file for MinGW but it seems MSVC needs it. How to modify *.pro file so it compiles for both MinGW and MSVC?
I already tried to add LIBS += -ladvapi32 -lcrypt32 but that doesn't work for MSVC compilation - I still get unresolved external symbols.
-
LIBS += -ladvapi32 -lcrypt32is enough. Make sure you re-run qmake after you edited the .pro file (Build - > Run qmake).