我有静态库和另一个使用它的程序。

在静态库中,如果我在没有内插的情况下定义 header ,则可以正常工作。

class TcpCommunication

另一方面,如果我在QT类中使用intencet,
class TcpCommunication:public QTcpServer

编译使用此静态库的代码时出现链接错误。
>MStoDKAPId.lib(TcpCommunication.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QTcpServer::~QTcpServer(void)" (__imp_??1QTcpServer@@UAE@XZ) referenced in function "public: virtual __thiscall TcpCommunication::~TcpCommunication(void)" (??1TcpCommunication@@UAE@XZ)

可能是什么问题?
谢谢。

最佳答案

使用您的静态库的应用程序还需要链接到QT

关于c++ - 继承类的链接错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2856721/

10-11 17:06