ak.
ak.

Reputation: 3449

Qt5.1 project with C++11 support - linking external libraries

I have a Qt5.1 project that also links against external library - DCMTK. I'm seeing lots of link errors that are coming from this external library:

Undefined symbols for architecture x86_64:
  "std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const", referenced from:
      DcmDicomDir::getDataset() in libdcmdata.a(dcdicdir.o)
      DcmDicomDir::getDirRecSeq(DcmDataset&) in libdcmdata.a(dcdicdir.o)
      ...

I'm using C++11 features, so my Qt project.pro has this: CONFIG += c++11. Where are the link errors coming from? Is is that DCMKT links against different C++ libraries? Do I need to change compilation flags for DCMTK library?

Upvotes: 0

Views: 399

Answers (2)

ak.
ak.

Reputation: 3449

Turned out to be a trivial task - configure DCMTK to use clang and libc++:

./configure CXXFLAGS="-stdlib=libc++" 
            LDFLAGS="-stdlib=libc++" 
            CC=/usr/bin/clang 
            CXX=/usr/local/clang++

Upvotes: 1

ExpatEgghead
ExpatEgghead

Reputation: 415

Yes, you will have to rebuild DMCTK. Good luck with that as I found the task nigh on impossible.

Upvotes: 0

Related Questions