开发者

using 3rd party library (libconfig) with Qt (C++)

开发者 https://www.devze.com 2023-03-30 02:22 出处:网络
I\'m having trouble getting a third party library (libconfig++) to work in Qt. When compiling in Qt, I get error messages such as:

I'm having trouble getting a third party library (libconfig++) to work in Qt.

When compiling in Qt, I get error messages such as:

undefined reference to `_imp___ZN9libconfig6ConfigC1Ev'
undefined reference to `_imp___ZN9libconfig6Config8readFileEPKc'
undefined reference to `_imp___ZNK9libconfig6Config5writeEP6_iobuf'

etc.

In my .pro file, I have:

LIBS += -L$$PWD/libconfig/lib -lconfig++

And I've added libconfig++.dll and libconfig++.lib to the correct folder.

This project uses another 3rd party library (in a similar way) successfully so I don't think it's a syntax or include problem.

It seems like it might be a C++ name mangling issue? How can I confirm this?

Right now, I build the library in VS 2008 (I've tried building it b开发者_开发技巧oth as a dynamic and static library, neither work). I think I've been able to do this in the past with other libraries. Is there some flag in VS that I'm not setting correctly?

Thanks


If your library is called "libconfig++.lib" you might have to change

LIBS += -L$$PWD/libconfig/lib -lconfig++ 

to

LIBS += -L$$PWD/libconfig/lib -llibconfig++ 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号