I'm sort of new to Qt, but I've run this by some more experienced coworkers, and they're stumped as well.
My job is to port the application from Qt3 to Qt4.3. I am using VS2005 with vs integration.
Pretty much all of the code is divided into dll projects. I've got one of the projects pretty much done except for a linker error.
Here's what it is:
class MyClass : public BaseClass
{
Q_OBJECT
public:
...
class MyClass : public BaseClass
{
Q_OBJECT
public:
...
To copy to clipboard, switch view to plain text mode
class DLL_EXPORT_MACRO BaseClass
: public QObject{
Q_OBJECT
public:
...
class DLL_EXPORT_MACRO BaseClass : public QObject
{
Q_OBJECT
public:
...
To copy to clipboard, switch view to plain text mode
Then I get this:
moc_myclass.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const BaseClass::staticMetaObject" (?staticMetaObject@BaseClass@@2UQMetaObject@@B)
moc_myclass.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const BaseClass::staticMetaObject" (?staticMetaObject@BaseClass@@2UQMetaObject@@B)
To copy to clipboard, switch view to plain text mode
Note that the base class and child class are in different projects in different directories, though the child project obviously includes the folder the base class's header is in.
In my search, I haven't seen anyone else with quite this situation, but there are people who have had a similar problem because they didn't qmake properly. Because of this, I'm wondering if I need to mess with the project settings to link in the base class's moc file, though I'm not sure how to go about this.
Any questions/suggestions would be greatly appreciated.
Bookmarks