PDA

View Full Version : Reg - QMetaObject Error



suresh
4th September 2006, 20:27
hai,
Now i converting Qt3 code into Qt4. While creating dll it gives the following error. I couldn't find where it occurs. The errors are

Creating library ..\..\bin\plugins\designer/zonetrader.lib and object ..\..\bin\plugins\designer/zonetrader.exp
moc_zonetrader.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const MyClass::staticMetaObject" (?staticMetaObject@MyClass@@2UQMetaObject@@B)
..\..\bin\plugins\designer/zonetrader.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

suresh.

jacek
4th September 2006, 20:33
Does AFTPluginBase class contain Q_OBJECT macro in its definition?

suresh
4th September 2006, 20:47
It contains QObject macro.

jacek
4th September 2006, 21:08
Did you run moc on it?

suresh
4th September 2006, 21:14
Yes, I run it.

jacek
4th September 2006, 21:23
And do you link your application with the code generated by moc for that class?

suresh
4th September 2006, 21:28
Actually i convert that class into lib file and include my application. Now my application inherit that class.

jacek
4th September 2006, 21:34
Actually i convert that class into lib file and include my application.
Is AFTPluginBase part of that library? If yes, do you link that library with code generated by moc?

suresh
4th September 2006, 21:43
Yes, I include in profile. In Qt3 i used the same manner

jacek
4th September 2006, 21:52
Yes, I include in profile.
Check your compilation log, not the settings.

One more thing: Is AFTPluginBase derived from QObject?

suresh
4th September 2006, 21:52
moc file is automatically generated. How can i link?

suresh
4th September 2006, 21:57
Yes.Its inherited. compilation log means..............

jacek
4th September 2006, 22:27
compilation log means..............
the exact commands that were executed, not your believes.