Qt调用自己编译的libglog.a出现问题

我确定依据正确导入库后,依旧出现未定义的引用。

undefined reference to _imp___ZN6google17InitGoogleLoggingEPKc

尝试过重新编译,调整编译参数,都不行。debug和release模式也没有影响。最后找到Stack Overflow上有这样一个问题

https://stackoverflow.com/questions/15726931/c-qt-undefined-reference-to-imp

大致意思是dllimport 原文:These macros are only used when compiling shared libraries because they imply DLL linkage (on Windows, at least)

所以删除掉使用了dllimport的宏就可以了

知识点:

dllimport声明的函数会在动态库寻找对应的函数

猜你喜欢

转载自www.cnblogs.com/Jacket-K/p/10072157.html
今日推荐