I'm running Microsoft Visual Studio 2005 (2.0.50727) with Qt Visual Studio Integration 1.2.2
I have a legacy application written by a person who is unavailable.
I added a new class by adding a new *.h header file and a new *.cpp C++ file. The new class was based on QObject, and the header file dutifully included the Q_OBJECT macro at the top of the class definition, along with some slots and signals.
When I compiled my project, I got a lot of error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall... errors. Examining the build output, I realized that MOC had been run on the original files, but not on my new file. There was no *_moc.cpp file generated for my new class.
I manually ran MOC.exe on my new header file, and manually inserted the resulting moc file into my project. This compiled and ran perfectly.
So my question is: what am I doing wrong to cause Qt Integration to fail to automatically run MOC on my new class?
Bookmarks