简体   繁体   English

使用QT构建与Studio Built链接的Visual Studio Qt项目时出现链接错误

[英]Link errors building a visual studio Qt project linking to a library buillt using QT

I have a library that uses QT. 我有一个使用QT的库。 The library was staticly linked with QT. 该库与QT静态链接。 I am now using this library in another application (exe) that also uses QT. 我现在在另一个也使用QT的应用程序(exe)中使用此库。 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. 我的假设是,通过静态链接库中的QT库可以避免这种情况。

How can keep these methods from being exported. 如何防止这些方法被导出。 Is a def File the answer? def文件是答案吗?

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 问题是(当我制作具有Qobject宏的edit cpp文件时,该问题(我仍然没有解决),其中设置了moc_ file属性从构建中排除,从而导致链接错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM