1

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

user399932
  • 11
  • 1
  • 2

3 Answers3

3

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

Community
  • 1
  • 1
MasterPlanMan
  • 992
  • 7
  • 14
0

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

Mike McQuaid
  • 9,615
  • 6
  • 33
  • 38
  • i have checked for lib i m adding becouse i also have source code of tha lib. even if i have created my own lib say testlib and included its header & lib in .pro file i getting the same error. – user399932 Jul 23 '10 at 10:18
0

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.

Narek
  • 38,779
  • 79
  • 233
  • 389