开发者

undefined reference of library function

i m trying to use DCMTK library built in MSVC in my qt application.although i have added libs in my .pro file like Libs+= -Ldcmtk开发者_如何学编程/lib -ofstd -dcmdata..i have also include .h files of these libraries but i m getting undefined reference error for each function i m calling of these library.. what i m missing..


Function names are not the same in the libs - c++ standard does not define it so both msvc and g++ define them their own way.

Check this post. Qt/mingw32 undefined reference errors... unable to link a .lib

There are some work-arounds like this for instance (dll): http://www.emmestech.com/moron_guides/moron1.html


If you are getting an undefined reference error then you haven't linked to the correct library.


You use Qt Creator?

Say you have a lib file named libodbc32.a Then you should add a lib like this:

LIBS += -L [path to the libodbc32.a] -L [path to libsystemc.a] -lodbc32 -lsystemc

So I think you have linked not in an appropriate way.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜