How to use class from a different project in C++ with Qt? -


there's class mailhandler in solution mailtest, use send signals class mailcom in solution mailresponse. problem revolves around creating object of mailhandler class in mailcom class, in different project, , doing operations here. efficient way of establishing connection without modifying mailtest project lib or dll?

i need link correct path, i'm not sure @ settings important in case. current error i'm getting when trying instantiate mailhandler object:

1>     creating library ..\..\bin\pvc6d.lib , object ..\..\bin\pvc6d.exp 1>cmailcom.obj : error lnk2019: unresolved external symbol "public: class qstringlist __thiscall mailhandler::returnallfunctions(void)" (?returnallfunctions@mailhandler@@qae?avqstringlist@@xz) referenced in function "public: __thiscall pvc::hardwarecom::cmailcom::cmailcom(class pvc::data::cdata &,class pvc::data::crudderservo *,class pvc::data::cpropulsionmanager *,class qgraphicsscene *)" (??0cmailcom@hardwarecom@pvc@@qae@aavcdata@data@2@pavcrudderservo@42@pavcpropulsionmanager@42@pavqgraphicsscene@@@z) 1>cmailcom.obj : error lnk2019: unresolved external symbol "public: __thiscall mailhandler::mailhandler(class qobject *)" (??0mailhandler@@qae@pavqobject@@@z) referenced in function "public: __thiscall pvc::hardwarecom::cmailcom::cmailcom(class pvc::data::cdata &,class pvc::data::crudderservo *,class pvc::data::cpropulsionmanager *,class qgraphicsscene *)" (??0cmailcom@hardwarecom@pvc@@qae@aavcdata@data@2@pavcrudderservo@42@pavcpropulsionmanager@42@pavqgraphicsscene@@@z) 1>..\..\bin\pvc6d.exe : fatal error lnk1120: 2 unresolved externals 

if want use class of external project, can try #include header file (mailhandler.h, mailhandler.hxx etc.). assume thats did. there according source file (mailhandler.cpp, mailhandler.cxx). can try add file current project. if lucky compiles , links , unresolved externals go away. more source file has other dependencies , not compile/link right away.

this rather hack - not robust long term solution. it's better copy file dependencies project it's best extract needed classes in separate project (i.e creating lib or dll) project , other solution 'mailtest' using independent client.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -