标题:链接 dll 的问题【已解决】
作者:lanmanck
日期:2020-10-09 14:51
内容:
搞了一天搞不定 带界面的dll和exe调用,dll是有了,但是exe 老是提示
moc_mainwindow.obj:-1: error: LNK2001: 无法解析的外部符号 "public: static struct QMetaObject const DllTest::staticMetaObject" (?staticMetaObject@DllTest@@2UQMetaObject@@B)
参考: https://blog.csdn.net/panchang199266/article/details/104733877
工程和测试工程一起上传:
#1 [lanmanck 10-09 15:14]
搞定了,是要 加入
#if defined(DLLTEST_LIBRARY)
#define DLLTEST_EXPORT Q_DECL_EXPORT
#else
#define DLLTEST_EXPORT Q_DECL_IMPORT
#endif