Hello! I'm a new user of dcmtk libraries. I have some linkings problems when I try to compile a simple code. This code makes an echo to the pacs. The error is the next
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
/usr/lib/dcmtk/libdcmdata.a(dcsequen.o)(.text+0xd3a): more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage' follow
I'm using Fedora 3, but A friend have tried to compile the same code with a mandrake 10, and the code works, the compile doesn't gets any error. I believe that the problem is the Fedora, there is any solution? Or the solution is that I have to install another libraries.
Thanks for your help.
Problems Undefined reference
Moderator: Moderator Team
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
You won't probably like this, but they may be many reasons for the error messages above, and it will not be possible to support you unless the error can somehow be reproduced. The error message is clear enough, a function of the stdio library that is used by your code cannot be resolved during the link process. You are either not linking all required libraries or you are linking wrong versions of these libraries. In any case, this is a most likely a problem with the installation of your C++ compiler, not with DCMTK.
Same problem
Any library gurus out there want to tackle this one?
I seem to have the same problem:
This is gcc 4.0.2. Remarking out the dcmtk stuffs gets me a file that builds without any warnings/errors.
Also, if I statically link in the stdc++ library, all is well:
g++ -static -o IRfispfit newfit.o qld.o cfsqp.o /usr/lib/libstdc++.a -L/usr/local/dicom/lib -lool -lgsl -lgslcblas -ldcmdata -lofstd -lpthread -lz
I am mystified as to why static works, but shared libs doesnt, but I'll keep poking....
I seem to have the same problem:
Code: Select all
g++ -o IRfispfit newfit.o qld.o cfsqp.o -L/usr/local/dicom/lib -lool -lgsl \
-lgslcblas -ldcmdata -lofstd -lpthread -lz -lstdc++
/usr/local/dicom/lib/libdcmdata.a(dcitem.o): In function `char* std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_construct<char*>(char*, char*, std::allocator<char> const&, std::forward_iterator_tag)':
dcitem.cc:(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x19): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
dcitem.cc:(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x1e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
dcitem.cc:(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x48): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned int, std::allocator<char> const&)'
collect2: ld returned 1 exit status
make: *** [IRfispfit] Error 1
Also, if I statically link in the stdc++ library, all is well:
g++ -static -o IRfispfit newfit.o qld.o cfsqp.o /usr/lib/libstdc++.a -L/usr/local/dicom/lib -lool -lgsl -lgslcblas -ldcmdata -lofstd -lpthread -lz
I am mystified as to why static works, but shared libs doesnt, but I'll keep poking....
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Who is online
Users browsing this forum: No registered users and 1 guest