My temporary fix for the gdcmDSEDTests is to make gdcm::String as a member of gdcm::CodeString. There're only a few minor changes to get the entire solution to build under VS2008.
The segFault in TestImageReader to an attempt to cerr a char* which is initialized to null when test-reading the following data file:
gdcm-CR-DCMTK-16-NonSamplePerPix.dcm
appearantly, the file does not have a valid media storage media UID and GetMSString(MS_END) returned a null pointer given the definition of MSStrings[] as:
static const char *MSStrings[] = {
"1.2.840.10008.1.3.10",
"1.2.840.10008.5.1.4.1.1.1",
...
"1.3.46.670589.5.0.10",
0
};
my suggestion is to change 0 to an empty string "". That way, when encountered with situation, the user can either check the length and performance special handling for the case, or allow the default behaviour which will output an empty string.
Xiaofeng Zhao
----------------------------------------
> From: xf10036@...
> To: niels_address_until_2010-10-10@...; mathieu.malaterre@...
> Date: Tue, 26 Jan 2010 10:30:11 -0500
> CC: gdcm-developers@...
> Subject: Re: [Gdcm2] gdcm2+VS2008+Windows7 64 bit
>
>
>
> I agree with Niels (in his issue report) that it's best not inherit from std::string. I can try to figure out how much would it take to make std::string a member of gdcm::String, if everyone thinks it is a good idea.
>
> Niels, thanks for pointing the right direction to the source of the build error!
>
> Xiaofeng
>
>
>
> ----------------------------------------
>> From: niels_address_until_2010-10-10@...
>> To: mathieu.malaterre@...; xf10036@...
>> CC: gdcm-developers@...
>> Subject: Re: [Gdcm2] gdcm2+VS2008+Windows7 64 bit
>> Date: Tue, 26 Jan 2010 12:19:11 +0100
>>
>> Mathieu Malaterre wrote:
>>> I think this has been fixed in svn trunk. If you really want the
>>> release simply turn testing off, or remove this test from the
>>> cmakelists.txt file.
>>
>> Sorry I don't think all the issues mentioned by Xiaofeng Zhao are fixed in
>> the trunk. My Visual Studio 2008 build also has a few test failures,
>> including TestImageWriter2. So I think it would be great if Xiaofeng wants
>> to dig into it :-)
>>
>> The gdcm::String link errors are also still there in the trunk version, for
>> MSVC users that build GDCM as DLL. (Having GDCM_BUILD_SHARED_LIBS ON). As I
>> reported last November: CodeString related link error (LNK2005) in
>> gdcmDSED - ID: 2901256
>> http://sourceforge.net/tracker/?func=detail&aid=2901256&group_id=137895&atid=739587
>>
>> My report also suggests some quickfix. But I'd rather have it fixed by a
>> little design change, getting rid of some inheritance. gdcm::CodeString now
>> inherits from gdcm::String, which inherits from std::string. std::string
>> wasn't really designed as a base class. For example, it doesn't have any
>> virtual functions.
>>
>> HTH,
>>
>> Niels
>>
>>> On Tue, Jan 26, 2010 at 2:19 AM, Xiaofeng Z wrote:
>>>>
>>>> I'm trying to build gdcm2 version 2.0.14 with Visual Studio 2008
>>>> professional edition.
>>>>
>>>> gdcmDSEDTests.exe fails to build with the following error:
>>>>
>>>> 1>gdcmDSED.lib(gdcmDSED.dll) : error LNK2005: "public: __cdecl
>>>> gdcm::String<92,16,32>::~String<92,16,32>(void)"
>>>> (??1?$String@...) already defined in
>>>> TestAttribute.obj 1>gdcmDSED.lib(gdcmDSED.dll) : error LNK2005:
>>>> "public: __cdecl gdcm::String<92,16,32>::String<92,16,32>(void)"
>>>> (??0?$String@...) already defined in
>>>> TestAttribute.obj
>>>> 1>D:\NYPH\IMAGING\bin\gdcm-2.0.14bin\bin\Debug\gdcmDSEDTests.exe :
>>>> fatal error LNK1169: one or more multiply defined symbols found
>>>>
>>>> I'm also getting some test failure when I tried to run "RUN_TESTS",
>>>> e.g.:
>>>>
>>>> Start 115: TestImageReader
>>>> 115/151 Test #115: TestImageReader
>>>> ............................***Exception: SegFault 31.01 sec
>>>> Start 116: TestDirectionCosines
>>>> ...
>>>> Start 143: TestImageWriter2
>>>> 143/151 Test #143: TestImageWriter2
>>>> ...........................***Failed 0.11 sec
>>>> Start 144: TestImageChangeTransferSyntax5
>>>>
>>>> Before I spend a lot of time digging into it, I would like to know
>>>> if these are known issues and if solutions will be available in
>>>> future release.
>>
>> --
>> Niels Dekker
>> http://www.xs4all.nl/~nd/dekkerware
>> Scientific programmer at LKEB, Leiden University Medical Center
>>
> _________________________________________________________________
> Hotmail: Trusted email with powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/196390707/direct/01/
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Gdcm-developers mailing list
> Gdcm-developers@...
> https://lists.sourceforge.net/lists/listinfo/gdcm-developers
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/196390709/direct/01/
|