c++ - Qt metaObject linker problem -



c++ - Qt metaObject linker problem -

after integrating qt vs , trying compile .pro file i'm getting next errors:

error 9 error lnk2001: unresolved external symbol "public: virtual int __thiscall multiplication_dialog::qt_metacall(enum qmetaobject::call,int,void * *)" (?qt_metacall@multiplication_dialog@@uaehw4call@qmetaobject@@hpapax@z) error 7 error lnk2001: unresolved external symbol "public: virtual struct qmetaobject const * __thiscall multiplication_dialog::metaobject(void)const " (?metaobject@multiplication_dialog@@ubepbuqmetaobject@@xz) error 8 error lnk2001: unresolved external symbol "public: virtual void * __thiscall multiplication_dialog::qt_metacast(char const *)" (?qt_metacast@multiplication_dialog@@uaepaxpbd@z)

what this?

you usally these errors when moc_foo.cpp foo.h (which contains class marked q_object) not compiled / linked in project.

to create qt project work in vs either

create .vcproj file 'qmake -tp vc' or use qt visual studio add-in handles moc magic automatically (doesn't work vc express versions though).

when using add-in can trigger creation of moc_foo.cpp by

make sure header file of object in question appears in vs project list item remove occurrances of q_object header file of multiplication_dialog. save file add q_object again save file

now should have 2 versions of moc_multiplication_dialog.cpp in "generated files" folder in solution explorer. 1 "debug" , 1 "release". create sure 1 of these files not excluded build.

c++ visual-studio-2010 qt

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -