Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
2.6.0
-
None
-
Visual Studio 2019 with Qt Visual Studio Tools 2.6.0, Qt 5.12.9 LTS
-
-
b8144fdf6bb032a67929f1caf4038373b1fdbf1c
Description
This is for QTVS 2.6.0, but this bug reporter doesn't let me select this version yet.
With Qt Visual Studio Tools 2.6.0, the moc compiler doesn't see defines from the .qmake.conf file. To reproduce this, I have attached a small sample project. I have imported this into VS 2019 via Extensions / Qt VS Tools / Open Qt Project File (.pro).
When opened with Visual Studio 2019 + Qt 5.12.9 + Qt VS Tools 2.5.2, the compiler outputs this:
1>------ Build started: Project: VsToolsTest, Configuration: Debug x64 ------
1>Uic'ing mainwindow.ui...
1>Moc'ing mainwindow.h...
1>main.cpp
1>mainwindow.cpp
1>moc_mainwindow.cpp
1>VsToolsTest.vcxproj -> C:\Users\me\Documents\Code\VsToolsTest\debug\VsToolsTest.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
When opening a clean copy of this project in Qt VS Tools 2.6.0, compilation fails:
1>------ Build started: Project: VsToolsTest, Configuration: Debug x64 ------
1>Generate moc_predefs.h
1>Uic'ing mainwindow.ui...
1>Moc'ing mainwindow.h...
1> C:\Users\me\Documents\Code\VsToolsTest\mainwindow.h(0): Note: No relevant classes found. No output generated.
1>main.cpp
1>mainwindow.cpp
1>moc_mainwindow.cpp
1>mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl MainWindow::metaObject(void)const " (?metaObject@MainWindow@@UEBAPEBUQMetaObject@@XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl MainWindow::qt_metacast(char const *)" (?qt_metacast@MainWindow@@UEAAPEAXPEBD@Z)
1>mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl MainWindow::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@MainWindow@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
1>debug
VsToolsTest.exe : fatal error LNK1120: 3 unresolved externals
1>Done building project "VsToolsTest.vcxproj" – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Attachments
Issue Links
- relates to
-
QTVSADDINBUG-821 moc: Too many input files specified:
-
- Closed
-
For Gerrit Dashboard: QTVSADDINBUG-822 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
317351,2 | Fix incorrect generation of command line options | dev | qt-labs/vstools | Status: MERGED | +2 | 0 |