Compilation error with "diregist.h"

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
dangreen
Posts: 12
Joined: Tue, 2014-06-24, 15:10

Compilation error with "diregist.h"

#1 Post by dangreen »

When i include "dcmtk/dcmimage/diregist.h" in my Qt project i get this errors:
Undefined symbols for architecture x86_64:
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(char const*) const", referenced from:
dcmtk::log4cplus::internal::parse_bool(bool&, OFString const&) in liboflog.a(env.o)
"std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str() const in libdcmimage.a(diregist.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str() const in libdcmimage.a(dihsvimg.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str() const in libdcmimage.a(dirgbimg.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str() const in libdcmimage.a(diybrimg.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str() const in libdcmimage.a(diargimg.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str() const in libdcmimage.a(dicmyimg.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str() const in libdcmimage.a(diyf2img.o)
...

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Compilation error with "diregist.h"

#2 Post by J. Riesmeier »

Did you compile DCMTK with HAVE_STL and/or HAVE_STD_STRING defined?

dangreen
Posts: 12
Joined: Tue, 2014-06-24, 15:10

Re: Compilation error with "diregist.h"

#3 Post by dangreen »

J. Riesmeier wrote:Did you compile DCMTK with HAVE_STL and/or HAVE_STD_STRING defined?
I compile DCMTK with standard Makefile

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Compilation error with "diregist.h"

#4 Post by J. Riesmeier »

More details would be helpful... So, as far as I understood, you successfully compiled and installed DCMTK with default settings?

dangreen
Posts: 12
Joined: Tue, 2014-06-24, 15:10

Re: Compilation error with "diregist.h"

#5 Post by dangreen »

J. Riesmeier wrote:More details would be helpful... So, as far as I understood, you successfully compiled and installed DCMTK with default settings?
I use OS X, I successfully compile and installed DCMTK with `make`. I can compile console app with this library ( and with "diregist.h" ), but in Qt ( I build GUI app ) I get the error.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Compilation error with "diregist.h"

#6 Post by J. Riesmeier »

... then the compiler/linker settings are apparently different for your Qt project (compared to the ones of the DCMTK).

I would suggest that you "google" for the linker error, and get something like this: "I suspect this issue is because of the two C++ runtime libraries available under OS X..."

dangreen
Posts: 12
Joined: Tue, 2014-06-24, 15:10

Re: Compilation error with "diregist.h"

#7 Post by dangreen »

J. Riesmeier wrote:... then the compiler/linker settings are apparently different for your Qt project (compared to the ones of the DCMTK).

I would suggest that you "google" for the linker error, and get something like this: "I suspect this issue is because of the two C++ runtime libraries available under OS X..."
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
Update:

i was edit pro file:
..macx {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
}

unix {
QMAKE_CXXFLAGS += -stdlib=libc++
LIBS += -L/usr/local/lib -lz -lijg8 -lijg12 -lijg16 -ltiff -lpng -lofstd -loflog -ldcmdata -ldcmimgle -ldcmimage -ldcmjpeg
INCLUDEPATH = /usr/local/include
}...
Now error the same.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Compilation error with "diregist.h"

#8 Post by J. Riesmeier »

... but you were not recompiling the DCMTK with these settings, right? You should also consider that by default DCMTK uses its own classes for strings, lists and so on. See compiler macros HAVE_STL and HAVE_STD_STRING, which are described in DCMTK's documentation.

Btw, the order of libraries to be linked to a program is usually significant!

dangreen
Posts: 12
Joined: Tue, 2014-06-24, 15:10

Re: Compilation error with "diregist.h"

#9 Post by dangreen »

J. Riesmeier wrote:... but you were not recompiling the DCMTK with these settings, right? You should also consider that by default DCMTK uses its own classes for strings, lists and so on. See compiler macros HAVE_STL and HAVE_STD_STRING, which are described in DCMTK's documentation.

Btw, the order of libraries to be linked to a program is usually significant!
Order of libraries is right.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest