Bug #471
closed
DcmAttributeFilter doesn't like DLLs
Added by Uli Schlachter over 12 years ago.
Updated about 9 years ago.
Assignee:
Jan Schlamelcher
Description
Hi,
when building the toolkit as shared libraries (with MSC6), dcmdata_tests.exe fails to link:
tfilter.obj: unresolved external symbol "[...] DcmAttributeFilter::createIteratorBasedFilter([...])
(Once for "OFString const * const &" and once for "char const * * const &")
I guess the compiler expects an explicit instantiation of the createIteratorBasedFilter() function template to be exported from the DLL.
So far I have not found any good way around that, just the attached hack which I call a "patch".
Ideas?
Files
That patch should work, but reduces the functionality for all other (non INSANE) compilers. Deducing the iterator type allows working with containers that don't specify const_iterator, which ist clearly more generic. I'll see if i can find a solution that keeps deducing alive, otherwhise MSVC6 might get another "Extrawurst"; possibly of the kind: "This features is not supported for ancient compilers."
For me even the proposed patch does not help as when the createIteratorBasedFilter-method is "fixed", the linker is missing the constructors implementation from then on. It seems VC6 generally doesn't allow mixing template methods in non template classes that are to be exported in shared objects.
Didn't you test the patch or did you use a different VC6 version? My experiments showed that the createIteratorBasedFilter method can also be "fixed" by declaring it friend instead of static -- but that is impossible for constructors.
I think it is time to say: "generic construction of DcmAttibuteFilter" requires Visual Studio 2003 or later...
- Status changed from New to Feedback
- % Done changed from 0 to 70
I now used #if defined checks in the testfile, so the iterator based functionality is not tested when compiling with VC6.
Probably a note should be added to the documentation of the relevant constructors not to use them with VC6.
I think I remember fighting with VC6 for a while and the problem was that either VC6 or GCC didn't like the code. I think that my earlier patch worked, but I cannot guarantee that I didn't forget to press the right button.
- Status changed from Feedback to Closed
- % Done changed from 70 to 100
The test has been fixed for quite some time now and nobody complained about my solution. So i think it's time to close it.
- Category set to Library
- Status changed from Closed to Reopened
- Target version changed from 3.6.1 to 3.6.2
- % Done changed from 100 to 80
This is probably because no one used this class with VC 6.0, and this class is not yet used anywhere within the DCMTK.
So, I reopened this issue with a new "target version" (next release).
- Status changed from Reopened to Closed
We have dropped support for VC6, therefore, this is no longer an issue.
- % Done changed from 80 to 100
Also available in: Atom
PDF