构建链接到使用 QT 构建的库的 Visual Studio Qt 项目时出现链接错误
我有一个使用 QT 的库。该库与 QT 静态链接。我现在在另一个也使用 QT 的应用程序 (exe) 中使用这个库。我遇到的问题是,当我编译时,我收到大量链接器重新定义错误。
我的假设是,通过静态链接我的库中的 QT 库,我可以避免这种情况。
如何防止这些方法被导出。 def 文件是答案吗?
I have a library that uses QT. The library was staticly linked with QT. I am now using this library in another application (exe) that also uses QT. The problem I am having is when I compile I receive a large number of Linker re-definition errors.
My assumption was that by static linking the QT libs in my library I would avoid this.
How can keep these methods from being exported. Is a def File the answer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找出了我的问题,该问题与静态库无关。问题是(我仍然没有解决)当我编辑具有 Qobject 宏的 cpp 文件时,设置了从构建中排除的 moc_ 文件属性,导致链接错误
I figured out my issue, the problem had nothing to do with the static libs. The problem was (which I still haven't solved) when I make an edit cpp files that have the Qobject macro the moc_ file property exclude from build is set resulting in link errors