简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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