user399932
user399932

Reputation: 11

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..

Upvotes: 1

Views: 3378

Answers (3)

MasterPlanMan
MasterPlanMan

Reputation: 1032

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

Upvotes: 3

Narek
Narek

Reputation: 39871

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.

Upvotes: 0

Mike McQuaid
Mike McQuaid

Reputation: 9814

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

Upvotes: 0

Related Questions