Hello, I can’t compile an easy code with Visual basic 2012 and qt for 32 bits. Some error messages with dll come to stop the process. I have already tried to add QT += core gui, QT += widgets, QT += sql and DEFINES += QT_NODLL in my .pro file, but it didn’t change anything.
My libpath is: D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5Gui;D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5Sql;D:\Qt\5.2.1\msvc2012\lib\cmake;D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5Declarative;D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5Designer;D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5Test;D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5;D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5Widgets;D:\Qt\5.2.1\msvc2012\lib\cmake\Qt5Core;D:\Qt\5.2.1\msvc2012\bin;D:\Qt\5.2.1\msvc2012\lib;$(LibraryPath)
The output message is:
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\Project1.pdb -DUNICODE -DWIN32 -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -I"." -I"D:\Qt\5.2.1\msvc2012\include" -I"D:\Qt\5.2.1\msvc2012\include\QtGui" -I"D:\Qt\5.2.1\msvc2012\include\QtANGLE" -I"D:\Qt\5.2.1\msvc2012\include\QtCore" -I"debug" -I"D:\Qt\5.2.1\msvc2012\mkspecs\win32-msvc2012" -Fodebug\ @D:\Users\fpellecc\AppData\Local\Temp\nm29B0.tmp
1> main.cpp
1> echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "debug\\Project1.exe.embed.manifest">debug\Project1.exe_manifest.rc
1> if not exist debug\Project1.exe if exist debug\Project1.exe.embed.manifest del debug\Project1.exe.embed.manifest
1> if exist debug\Project1.exe.embed.manifest copy /Y debug\Project1.exe.embed.manifest debug\Project1.exe_manifest.bak
1> link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:debug\Project1.exe.embed.manifest /OUT:debug\Project1.exe @D:\Users\fpellecc\AppData\Local\Temp\nm5755.tmp
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QApplication::QApplication(int &,char * *,int)" (__imp_??0QApplication@@QAE@AAHPAPADH@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QApplication::~QApplication(void)" (__imp_??1QApplication@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl QApplication::exec(void)" (__imp_?exec@QApplication@@SAHXZ) referenced in function _main
1>debug\Project1.exe : fatal error LNK1120: 3 unresolved externals
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.EXE"' : return code '0x460'
1> Stop.
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\nmake.exe"' : return code '0x2'
1> Stop.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(43,5): error MSB3073: The command "qmake && nmake debug-clean debug" exited with code 2.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
The code is:
#include <QApplication>
#include <QtWidgets>
int main (int argc, char *argv[])
{
QApplication app(argc, argv);
// QPushButton bouton("Coucou!");
// bouton.show();
return app.exec();
}
Would anyone have a solution about this problem?
↧