DCMTK 3.6.0 configures and compiles without any problem on gcc 3.3. However, I took the snapshot of 3.6.1 (dcmtk-3.6.1_20120515) and it configures but does not compile. I was wondering if there was some key new compiler feature needed for 3.6.1... My C++ is not good enough to know or if there may be a bug.
g++ -DHAVE_CONFIG_H -DDCMTK_BUILD_DATE=\"2012-05-15\" -DUSE_NULL_SAFE_OFSTRING -DNDEBUG -c -I. -I. -I../include -I../../config/include -I../include -I../../ofstd/include -I../../oflog/include \
-O -I/usr/include/libxml2 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -Wall telemlen.cc
telemlen.cc: In member function `virtual void
OFTestdcmdata_elementLength_pixelItem::run()':
telemlen.cc:103: error: syntax error before `,' token
telemlen.cc:104: error: invalid initialization of non-const reference of type '
DcmElement&' from a temporary of type 'DcmPixelItem (*)(...)'
telemlen.cc:40: error: in passing argument 1 of `void
testElementLengthForElem(DcmElement&, const char*, long int)'
telemlen.cc: In member function `virtual void
OFTestdcmdata_elementLength_pixelSequence::run()':
telemlen.cc:110: error: syntax error before `,' token
telemlen.cc:111: error: invalid initialization of non-const reference of type '
DcmElement&' from a temporary of type 'DcmPixelSequence (*)(...)'
telemlen.cc:40: error: in passing argument 1 of `void
testElementLengthForElem(DcmElement&, const char*, long int)'
make[2]: *** [telemlen.o] Error 1
make[2]: Leaving directory `/home/spas/recon/dcmtk-3.6.1_20120515/dcmdata/tests'
make[1]: *** [tests-all] Error 2
make[1]: Leaving directory `/home/spas/recon/dcmtk-3.6.1_20120515/dcmdata'
make: *** [dcmdata-all] Error 2
The offending lines (103-4) in ./dcmdata/tests/telemlen.cc are on the 5th-6th lines below:
OFTEST(dcmdata_elementLength_pixelItem)
{
// EVR_pixelItem only makes sense for class DcmPixelItem.
// In fact, it enforces that VR in the constructor.
DcmPixelItem pi(DcmTag(DCM_PatientName, DcmVR(EVR_pixelItem)));
testElementLengthForElem(pi, "PixelItem", 8);
}
diff --git a/dcmdata/tests/telemlen.cc b/dcmdata/tests/telemlen.cc
index d30dcb7..3724057 100644
--- a/dcmdata/tests/telemlen.cc
+++ b/dcmdata/tests/telemlen.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright (C) 2011, OFFIS e.V.
+ * Copyright (C) 2011-2012, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
@@ -93,14 +93,16 @@ OFTEST(dcmdata_elementLength_pixelItem)
{
// EVR_pixelItem only makes sense for class DcmPixelItem.
// In fact, it enforces that VR in the constructor.
- DcmPixelItem pi(DcmTag(DCM_PatientName, DcmVR(EVR_pixelItem)));
+ const DcmTag tag(DCM_PatientName, DcmVR(EVR_pixelItem));
+ DcmPixelItem pi(tag);
testElementLengthForElem(pi, "PixelItem", 8);
}
OFTEST(dcmdata_elementLength_pixelSequence)
{
// DcmPixelSequence forces EVR_OB, no point in trying other VRs.
- DcmPixelSequence ps(DcmTag(DCM_PatientName, DcmVR(EVR_OB)));
+ const DcmTag tag(DCM_PatientName, DcmVR(EVR_OB));
+ DcmPixelSequence ps(tag);
testElementLengthForElem(ps, "PixelSeq", 20);
}