[Dcmlib] Undefined Symbols error - GDCM::Sorter

Dr Nick Patterson pattersonnp.work at gmail.com
Wed Apr 2 17:06:31 CEST 2014


Hi,
  I am using GDCM in a project that I am working on which handles DICOM images. I have been successfully developing this on Ubuntu linux, but recently when porting over to MacOSX (Mavericks) I am having some difficulties with some of the functionality of GDCM that worked without flaw on Linux, but will not compile on Mac.

 I tested the most basic code that will replicate the problem that I have ( Undefined symbols for architecture x86_64), and it seems that the code at http://gdcm.sourceforge.net/html/SortImage_8cxx-example.html is an example of some code which throws up this error. Incidentally, it is the gdcm::sorter type stuff that I am using in my project which causes this problem, hence why I chose this example.

  I thought that it had something to do with the libraries not linking correctly upon compilations, but there are other GDCM examples which do compile, suggesting that everything is defined ok.


The full output of the compilation failure is:-

Undefined symbols for architecture x86_64:
"gdcm::Sorter::StableSort(std::vector<std::string, std::allocator<std::string> > const&)", referenced from:
_main in main.o
"gdcm::Sorter::SetSortFunction(bool (*)(gdcm::DataSet const&, gdcm::DataSet const&))", referenced from:
_main in main.o
"gdcm::Sorter::Sort(std::vector<std::string, std::allocator<std::string> > const&)", referenced from:
_main in main.o
"gdcm::Sorter::Sorter()", referenced from:
_main in main.o
"gdcm::Sorter::~Sorter()", referenced from:
_main in main.o
"gdcm::Scanner::Scan(std::vector<std::string, std::allocator<std::string> > const&)", referenced from:
_main in main.o
"gdcm::Scanner::AddTag(gdcm::Tag const&)", referenced from:
_main in main.o
"gdcm::Scanner::~Scanner()", referenced from:
_main in main.o
"gdcm::Subject::Subject()", referenced from:
gdcm::Scanner::Scanner() in main.o
"gdcm::Subject::~Subject()", referenced from:
gdcm::Scanner::Scanner() in main.o
"gdcm::Directory::Explore(std::string const&, bool)", referenced from:
gdcm::Directory::Load(std::string const&, bool) in main.o
"gdcm::VR::Compatible(gdcm::VR const&) const", referenced from:
gdcm::Attribute<(unsigned short)32, (unsigned short)82, 4194304, 1>::SetFromDataElement(gdcm::DataElement const&) in main.o
gdcm::Attribute<(unsigned short)32, (unsigned short)50, 32, 4>::SetFromDataElement(gdcm::DataElement const&) in main.o
gdcm::Attribute<(unsigned short)24, (unsigned short)4192, 32, 1>::SetFromDataElement(gdcm::DataElement const&) in main.o
"gdcm::Sorter::Print(std::ostream&) const", referenced from:
_main in main.o
"gdcm::DataSet::GetDEEnd() const", referenced from:
gdcm::DataSet::GetDataElement(gdcm::Tag const&) const in main.o
"gdcm::Directory::Print(std::ostream&) const", referenced from:
_main in main.o
"typeinfo for gdcm::Value", referenced from:
gdcm::DataElement::GetByteValue() const in main.o
typeinfo for gdcm::ByteValue in main.o
"vtable for gdcm::Scanner", referenced from:
gdcm::Scanner::Scanner() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [GDCMPro] Error 1
15:53:24: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project GDCMPro (kit: Qt 5.2.1)
When executing step ‘Make'



If someone could offer advice on this error, it would be very much appreciated.

Regards, Nick Patterson.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/dcmlib/attachments/20140402/d9cc0b9c/attachment-0001.html>


More information about the Dcmlib mailing list