Unable to build quazip. moc compiler dooesn't run. Command line finds no relevant classes

168 views Asked by At

I just downloaded the latest version of quazip. I'm using visual studio 2012 and QT 5.1.

There are three moc files required. The visual studio project doesn't seem to create them. I don't see the moc compiler even trying. I tried to build them from the command line, but I ended up with empty files. The linker then generates a lot of these errors

error LNK2001: unresolved external symbol "public: static struct QMetaObject const QuaZipFile::staticMetaObject" (?staticMetaObject@QuaZipFile@@2UQMetaObject@@B)

This is the command that I used to run the moc compiler (and similar command for the other two files):

C:\Tools64\v2.0.6\Qt-5.1.0\bin\moc -o moc_quazipfile.cpp quazipfile.cpp

that command generates the following error:

quazipfile.cpp(0): Note: No relevant classes found. No output generated.

I do see the Q_OBJECT definition in QuaZipFile, so it should have found something.

2

There are 2 answers

0
user3407352 On

It looks like the suggestion about to do "C:\Tools64\v2.0.6\Qt-5.1.0\bin\moc -o moc_quazipfile.cpp quazipfile.h" may have worked.

Evidently, the visual studio project released with the latest quazip is not functional.

0
Sergio Monteleone On

I'm not sure you should run moc manually...

Are you sure the Qt plugin / addin for Visual Studio is up to date?

Alternatively, you can just use qmake to compile.

Run:

qmake quazip.pro

This will generate the makefiles according to your Qt SDK mkspecs. If you are using MSVC, it should generate a makefile for nmake.

Then, simply type

nmake -f Makefile 

from the MSVC command line prompt (you should have several entries in your start menu, depending on the architecture you are compiling for)