解决方案MailTest中有这个类MailHandler,我用它来向解决方案MailResponse中的MailCom类发送信号。我的问题围绕在 MailCom 类中创建 MailHandler 类的对象,该类位于不同的项目中,并从这里进行操作。在不将 MailTest 项目修改为 lib 或 DLL 的情况下建立连接的最有效方法是什么?
我需要链接到正确的路径,但我不确定在这种情况下哪些设置很重要。这是我在尝试实例化 MailHandler 对象时遇到的当前错误:
1> Creating library ..\..\bin\pvc6d.lib and 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