I am trying to build QT project in VS12. I am using qt_4.8.2 and i done qt installation without any error. However when i build project i got LNK201 external errors.
Here is build log :
Build started 24.4.2014 09:48:38.
1>Project "C:\Users\musa\Documents\Work\Face SDK\NEW SDK\face_sdk-0.1.3-windows-x86-nodata-fixed\face_sdk\example\test_facerec.vcxproj" on node 2 (Build target(s)).
1>Link:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"..\bin\test_facerec.exe" /NOLOGO /LIBPATH:d:\qt_4.8.2\lib d:\qt_4.8.2\lib\QtXmld4.lib d:\qt_4.8.2\lib\QtGuid4.lib d:\qt_4.8.2\lib\QtCored4.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /SAFESEH "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" .obj\main.obj
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString##QAE#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (__imp_??0QString##QAE#PBD#Z) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall QString::toStdString(void)const " (__imp_?toStdString#QString##QBE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QFile::QFile(class QString const &)" (__imp_??0QFile##QAE#ABVQString###Z) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QFile::~QFile(void)" (__imp_??1QFile##UAE#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall QFile::open(class QFlags<enum QIODevice::OpenModeFlag>)" (__imp_?open#QFile##UAE_NV?$QFlags#W4OpenModeFlag#QIODevice#####Z) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDomNode & __thiscall QDomNode::operator=(class QDomNode const &)" (__imp_??4QDomNode##QAEAAV0#ABV0##Z) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDomNode::~QDomNode(void)" (__imp_??1QDomNode##QAE#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDomNode __thiscall QDomNode::firstChild(void)const " (__imp_?firstChild#QDomNode##QBE?AV1#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDomNode __thiscall QDomNode::nextSibling(void)const " (__imp_?nextSibling#QDomNode##QBE?AV1#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QDomNode::isNull(void)const " (__imp_?isNull#QDomNode##QBE_NXZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDomElement __thiscall QDomNode::toElement(void)const " (__imp_?toElement#QDomNode##QBE?AVQDomElement##XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDomDocument::QDomDocument(void)" (__imp_??0QDomDocument##QAE#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDomDocument::~QDomDocument(void)" (__imp_??1QDomDocument##QAE#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDomElement __thiscall QDomDocument::documentElement(void)const " (__imp_?documentElement#QDomDocument##QBE?AVQDomElement##XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QDomDocument::setContent(class QIODevice *,class QString *,int *,int *)" (__imp_?setContent#QDomDocument##QAE_NPAVQIODevice##PAVQString##PAH2#Z) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QDomElement::tagName(void)const " (__imp_?tagName#QDomElement##QBE?AVQString##XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QDomElement::text(void)const " (__imp_?text#QDomElement##QBE?AVQString##XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDomElement::~QDomElement(void)" (__imp_??1QDomElement##QAE#XZ) referenced in function "public: bool __thiscall pbio::QtServiceConfig::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load#QtServiceConfig#pbio##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>..\bin\test_facerec.exe : fatal error LNK1120: 19 unresolved externals
1>Done Building Project "C:\Users\musa\Documents\Work\Face SDK\NEW SDK\face_sdk-0.1.3-windows-x86-nodata-fixed\face_sdk\example\test_facerec.vcxproj" (Build target(s)) -- FAILED.
Build FAILED.
Time Elapsed 00:00:01.38
Could you help me how to solve this issue ?
Related
I am trying to connect to a database I created using DB BROWSER for SQLite have used this code to connect to my database. But it keeps giving errors while compiling. I tried following a YouTube tutorial as well and did as it said but got loads of errors.
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(":/accounts/login.db");
db.open();
the errors I am getting:
agent.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QSqlDatabase::setDatabaseName(class QString const &)" (__imp_?setDatabaseName#QSqlDatabase##QEAAXAEBVQString###Z)
<br>referenced in function<br>
"public: __cdecl agent::agent(class QWidget *)" (??0agent##QEAA#PEAVQWidget###Z)
agent.obj:-1: error: LNK2019: unresolved external symbol "_declspec(dllimport) public: static char const * const QSqlDatabase::defaultConnection" (__imp?defaultConnection#QSqlDatabase##2PEBDEB)
<br>referenced in function<br>
"public: __cdecl agent::agent(class QWidget *)" (??0agent##QEAA#PEAVQWidget###Z)
agent.obj:-1: error: LNK2019: unresolved external symbol "_declspec(dllimport) public: static class QSqlDatabase __cdecl QSqlDatabase::addDatabase(class QString const &,class QString const &)" (__imp?addDatabase#QSqlDatabase##SA?AV1#AEBVQString##0#Z)
<br>referenced in function<br>
"public: __cdecl agent::agent(class QWidget *)" (??0agent##QEAA#PEAVQWidget###Z)
agent.obj:-1: error: LNK2019: unresolved external symbol "_declspec(dllimport) public: void __cdecl QSqlDatabase::setDatabaseName(class QString const &)" (__imp?setDatabaseName#QSqlDatabase##QEAAXAEBVQString###Z)
<br>referenced in function<br>
"public: __cdecl agent::agent(class QWidget *)" (??0agent##QEAA#PEAVQWidget###Z)
agent.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QSqlDatabase __cdecl QSqlDatabase::addDatabase(class QString const &,class QString const &)" (__imp_?addDatabase#QSqlDatabase##SA?AV1#AEBVQString##0#Z)
<br>referenced in function<br>
"public: __cdecl agent::agent(class QWidget *)" (??0agent##QEAA#PEAVQWidget###Z)
agent.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: static char const * const QSqlDatabase::defaultConnection" (__imp_?defaultConnection#QSqlDatabase##2PEBDEB)
<br>referenced in function<br>
"public: __cdecl agent::agent(class QWidget *)" (??0agent##QEAA#PEAVQWidget###Z)
I am building opencv 4.3.0 in the windows-vs2015, using cmake3.17.3, with WITH_QT enabled. Here are errors messages related to opencv_contrib module cvv in the building process:
Creating library C:/opencv/opencv-4.3.0-cbuild/lib/Release/opencv_world430.lib and object C:/opencv/opencv-4.3.0-cbuild/lib/Release/opencv_world430.exp
view_controller.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl cvv::gui::CallTab::metaObject(void)const " (?metaObject#CallTab#gui#cvv##UEBAPEBUQMetaObject##XZ)
image_call_tab.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl cvv::gui::CallTab::metaObject(void)const " (?metaObject#CallTab#gui#cvv##UEBAPEBUQMetaObject##XZ)
view_controller.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl cvv::gui::CallTab::qt_metacast(char const *)" (?qt_metacast#CallTab#gui#cvv##UEAAPEAXPEBD#Z)
image_call_tab.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl cvv::gui::CallTab::qt_metacast(char const *)" (?qt_metacast#CallTab#gui#cvv##UEAAPEAXPEBD#Z)
view_controller.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl cvv::gui::CallTab::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#CallTab#gui#cvv##UEAAHW4Call#QMetaObject##HPEAPEAX#Z)
image_call_tab.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl cvv::gui::CallTab::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#CallTab#gui#cvv##UEAAHW4Call#QMetaObject##HPEAPEAX#Z)
view_controller.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject
.........
C:\opencv\opencv-4.3.0-cbuild\bin\Release\opencv_world430.dll : fatal error LNK1120: 226 unresolved externals
What is the problem with these errors? I googled online and found some similar posts (https://answers.opencv.org/question/210338/build-error-when-activating-both-cvv-and-world/; Linking errors for Qt and cvv when building OpenCV in Windows 10). It seems that BUILD_opencv_world, WITH_QT and Build_opencv_cvv cannot be activated simultaneously for building. Should I need to remove the cvv module from the opencv_contrib folder?
I am trying to upgrade my Qt-project settings from Visual Studio 2013 to 2015. It almost done but I get some errors with qtmaind.lib.
1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external
symbol imp__RoInitialize#4 referenced in function _WinMain#16
1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external
symbol __imp__RoGetActivationFactory#12 referenced in function
"public: __thiscall AppContainer::AppContainer(void)"
(??0AppContainer##QAE#XZ) 1>qtmaind.lib(qtmain_winrt.obj) : error
LNK2019: unresolved external symbol _WindowsCreateStringReference#16
referenced in function "private: void __thiscall
Microsoft::WRL::Wrappers::HStringReference::CreateReference(wchar_t
const *,unsigned int,unsigned int)"
(?CreateReference#HStringReference#Wrappers#WRL#Microsoft##AAEXPB_WII#Z)
1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external
symbol _WindowsDeleteString#4 referenced in function "public: void
__thiscall Microsoft::WRL::Wrappers::HString::Release(void)" (?Release#HString#Wrappers#WRL#Microsoft##QAEXXZ)
1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external
symbol _WindowsGetStringRawBuffer#8 referenced in function "public:
wchar_t const * __thiscall
Microsoft::WRL::Wrappers::HString::GetRawBuffer(unsigned int *)const "
(?GetRawBuffer#HString#Wrappers#WRL#Microsoft##QBEPB_WPAI#Z)
1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external
symbol _RoOriginateError#8 referenced in function "public: static void
__cdecl Microsoft::WRL::ErrorHelper<0>::OriginateError(long,struct HSTRING *)"
(?OriginateError#?$ErrorHelper#$0A##WRL#Microsoft##SAXJPAUHSTRING__###Z)
Qt 5.6-rc (22-Feb-2016 15:11)
link to WindowsApp.lib. That should resolve your issues.
At least for getting GetActivationFactory, you need to link to runtimeobject.lib.
I would like to integrate opencv249 with Qt 5.5. My .pro file is like that:
INCLUDEPATH += C:/OpenCV249/opencv/build/include
INCLUDEPATH += C:/OpenCV249/opencv/build/include/opencv
INCLUDEPATH += C:/OpenCV249/opencv/build/include/opencv2
LIBS += -LC:/OpenCV249/opencv/build/x86/vc12/lib
LIBS += -lopencv_core249 -lopencv_highgui249 -lopencv_imgproc249 -lopencv_features2d249 -lopencv_calib3d249
My code is like that:
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/core.hpp"
using namespace cv;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Mat im=imread("1.jpg");
imshow("kubi",im);
return a.exec();
}
It gives those errors:
main.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPEAX#Z) referenced in function "public: __cdecl cv::Mat::~Mat(void)" (??1Mat#cv##QEAA#XZ)
main.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray#cv##QEAA#AEBVMat#1##Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QEAAXXZ) referenced in function "public: void __cdecl cv::Mat::release(void)" (?release#Mat#cv##QEAAXXZ)
main.obj:-1: error: LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YAHPEAHH#Z) referenced in function "public: void __cdecl cv::Mat::release(void)" (?release#Mat#cv##QEAAXXZ)
main.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow#cv##YAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##AEBV_InputArray#1##Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?imread#cv##YA?AVMat#1#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function main
debug\Sercan.exe:-1: error: LNK1120: 6 unresolved externals
I don't know how to fix it.
Is your lib path correct?
Should you change
LIBS += -LC:/opencv/build/x86/vc12/lib
with
LIBS += -LC:/OpenCV249/opencv/build/x86/vc12/lib
?
It's only a wild guess, everything else looks OK...
I've tried to follow this article:
http://www.ics.com/blog/combining-qt-widgets-and-qml-qwidgetcreatewindowcontainer#.UlVUExCXcnI
If I try to redo this I get this error:
15:13:36: Running steps for project Test_QMLWidgets01...
15:13:36: Configuration unchanged, skipping qmake step.
15:13:36: Starting: "C:\Qt\Qt5\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -I"C:\Qt\Qt5\5.1.0\msvc2010\include" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtWidgets" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtGui" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtANGLE" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtCore" -I"debug" -I"." -I"." -I"C:\Qt\Qt5\5.1.0\msvc2010\mkspecs\win32-msvc2010" -Fodebug\ #C:\Users\VANBEB~1\AppData\Local\Temp\mainwindow.obj.3328.0.jom
mainwindow.cpp
..\Test_QMLWidgets01\mainwindow.cpp(2) : fatal error C1083: Cannot open include file: 'QQuickView': No such file or directory
jom: E:\QtProjects\build-Test_QMLWidgets01-Desktop_Qt_5_1_0_MSVC2010_32bit-Debug\Makefile.Debug [debug\mainwindow.obj] Error 2
jom: E:\QtProjects\build-Test_QMLWidgets01-Desktop_Qt_5_1_0_MSVC2010_32bit-Debug\Makefile [debug] Error 2
15:13:36: The process "C:\Qt\Qt5\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project Test_QMLWidgets01 (kit: Desktop Qt 5.1.0 MSVC2010 32bit)
When executing step 'Make'
15:13:36: Elapsed time: 00:00.
So I changed #include to #include but then I get linking errors:
15:16:27: Running steps for project Test_QMLWidgets01...
15:16:27: Configuration unchanged, skipping qmake step.
15:16:27: Starting: "C:\Qt\Qt5\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -I"C:\Qt\Qt5\5.1.0\msvc2010\include" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtWidgets" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtGui" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtANGLE" -I"C:\Qt\Qt5\5.1.0\msvc2010\include\QtCore" -I"debug" -I"." -I"." -I"C:\Qt\Qt5\5.1.0\msvc2010\mkspecs\win32-msvc2010" -Fodebug\ #C:\Users\VANBEB~1\AppData\Local\Temp\mainwindow.obj.4220.15.jom
mainwindow.cpp
echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID / 24 / RT_MANIFEST */ "debug\Test_QMLWidgets01.exe.embed.manifest">debug\Test_QMLWidgets01.exe_manifest.rc
if not exist debug\Test_QMLWidgets01.exe if exist debug\Test_QMLWidgets01.exe.embed.manifest del debug\Test_QMLWidgets01.exe.embed.manifest
if exist debug\Test_QMLWidgets01.exe.embed.manifest copy /Y debug\Test_QMLWidgets01.exe.embed.manifest debug\Test_QMLWidgets01.exe_manifest.bak
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\Test_QMLWidgets01.exe.embed.manifest /OUT:debug\Test_QMLWidgets01.exe #C:\Users\VANBEB~1\AppData\Local\Temp\Test_QMLWidgets01.exe.4220.2886.jom
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void _thiscall QQuickView::setSource(class QUrl const &)" (_imp_?setSource#QQuickView##QAEXABVQUrl###Z) referenced in function "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow##QAE#PAVQWidget###Z)
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QQuickView::QQuickView(class QWindow *)" (_imp??0QQuickView##QAE#PAVQWindow###Z) referenced in function "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow##QAE#PAVQWidget###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall QQuickView::metaObject(void)const " (?metaObject#QQuickView##UBEPBUQMetaObject##XZ)
mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QQuickView::qt_metacast(char const *)" (?qt_metacast#QQuickView##UAEPAXPBD#Z)
mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QQuickView::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#QQuickView##UAEHW4Call#QMetaObject##HPAPAX#Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall QQuickWindow::event(class QEvent *)" (?event#QQuickWindow##MAE_NPAVQEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickView::timerEvent(class QTimerEvent *)" (?timerEvent#QQuickView##MAEXPAVQTimerEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual class QAccessibleInterface * __thiscall QQuickWindow::accessibleRoot(void)const " (?accessibleRoot#QQuickWindow##UBEPAVQAccessibleInterface##XZ)
mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual class QObject * __thiscall QQuickWindow::focusObject(void)const " (?focusObject#QQuickWindow##UBEPAVQObject##XZ)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickWindow::exposeEvent(class QExposeEvent *)" (?exposeEvent#QQuickWindow##MAEXPAVQExposeEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickView::resizeEvent(class QResizeEvent *)" (?resizeEvent#QQuickView##MAEXPAVQResizeEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickWindow::focusInEvent(class QFocusEvent *)" (?focusInEvent#QQuickWindow##MAEXPAVQFocusEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickWindow::focusOutEvent(class QFocusEvent *)" (?focusOutEvent#QQuickWindow##MAEXPAVQFocusEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickWindow::showEvent(class QShowEvent *)" (?showEvent#QQuickWindow##MAEXPAVQShowEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickWindow::hideEvent(class QHideEvent *)" (?hideEvent#QQuickWindow##MAEXPAVQHideEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickView::keyPressEvent(class QKeyEvent *)" (?keyPressEvent#QQuickView##MAEXPAVQKeyEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickView::keyReleaseEvent(class QKeyEvent *)" (?keyReleaseEvent#QQuickView##MAEXPAVQKeyEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickView::mousePressEvent(class QMouseEvent *)" (?mousePressEvent#QQuickView##MAEXPAVQMouseEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickView::mouseReleaseEvent(class QMouseEvent *)" (?mouseReleaseEvent#QQuickView##MAEXPAVQMouseEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickWindow::mouseDoubleClickEvent(class QMouseEvent *)" (?mouseDoubleClickEvent#QQuickWindow##MAEXPAVQMouseEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickView::mouseMoveEvent(class QMouseEvent *)" (?mouseMoveEvent#QQuickView##MAEXPAVQMouseEvent###Z)
mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QQuickWindow::wheelEvent(class QWheelEvent *)" (?wheelEvent#QQuickWindow##MAEXPAVQWheelEvent###Z)
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual _thiscall QQuickView::~QQuickView(void)" (_imp_??1QQuickView##UAE#XZ) referenced in function "public: virtual void * _thiscall QQuickView::scalar deleting destructor'(unsigned int)" (??_GQQuickView##UAEPAXI#Z)
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool)" (__imp_??0QQmlDebuggingEnabler##QAE#_N#Z) referenced in function "void __cdecldynamic initializer for 'qmlEnableDebuggingHelper''(void)" (??_EqmlEnableDebuggingHelper##YAXXZ)
debug\Test_QMLWidgets01.exe : fatal error LNK1120: 24 unresolved externals
jom: E:\QtProjects\build-Test_QMLWidgets01-Desktop_Qt_5_1_0_MSVC2010_32bit-Debug\Makefile.Debug [debug\Test_QMLWidgets01.exe] Error 1120
jom: E:\QtProjects\build-Test_QMLWidgets01-Desktop_Qt_5_1_0_MSVC2010_32bit-Debug\Makefile [debug] Error 2
15:16:30: The process "C:\Qt\Qt5\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project Test_QMLWidgets01 (kit: Desktop Qt 5.1.0 MSVC2010 32bit)
When executing step 'Make'
15:16:30: Elapsed time: 00:04.
What am I doing wrong?
I think that you need to add to your .pro file:
QT += core gui widgets quick