[Insight-developers] 10 compilation errors in itkHashTableTest.cxx (SunCC, Solaris)

Attila Nagy nagy.attila at yahoo.com
Mon Nov 8 09:01:46 EST 2010


Hi folks,

I sent a mail about a week ago about the problem in the subject.
I have found a working solution for problem #3 bellow (checked by an experienced Sun-tool-user :), cc'ed).

Could please somebody take a look at it, and maybe check in the changes? I use Studio Express 10/06 (or is that 06/10?) if that matters.

So I found that in file
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itk_hashtable.h?view=log&root=Insight&pathrev=ITK-3-18  (we use this
specific version in Slicer at the moment)

there is a code snippet for compatibility (from line 1145); and in line 1147 we have

# if defined (_MSC_VER) || defined(__BORLANDC__) || ((defined(__ICC)||defined(__ECC)) && defined(linux))

and I thought that if there is MSVC AND Borland AND Intel's icc then let's put __SUNPRO__CC in there, and voilá - it works:

# if defined (_MSC_VER) || defined(__BORLANDC__) || ((defined(__ICC)||defined(__ECC)) && defined(linux)) || defined    __SUNPRO_CC

With this ifedef it compiles very fine, not even a warning...


Problem #1 is still being looked at, as it should be enough to include <cstring>, but it's not - while including string.h definitely solves the problem, tt shouldn't be this way... So I'll check a few more things.

Thanks very much,
Attila

--- On Tue, 11/2/10, Attila Nagy <nagy.attila at yahoo.com> wrote:

> From: Attila Nagy <nagy.attila at yahoo.com>
> Subject: [Insight-developers] 10 compilation errors in itkHashTableTest.cxx (SunCC, Solaris)
> To: "Itk list" <insight-developers at itk.org>
> Date: Tuesday, November 2, 2010, 5:31 PM
> Hi all,
> 
> I got a few maybe-ITK-related errors during Slicer's tests
> (see them here: http://www.cdash.org/CDash/viewBuildError.php?buildid=765924
> ), and I was advised to do an experimental ITK build (thanks
> Steve! :)).
> 
> No errors during "normal" build, but a few did pop up now,
> and the last stack (10 in one file!!) really got me.
> (see "orlprint" machine on the Insight-dashboard from the
> 1st. of Nov)
> 
> Two compilation errors could be simply overcome - see 1.)
> and 2.)
> 
> But 3.) is... far beyond my skills...
> Could please somebody take a look at it? To me they look
> very ugly... :)
> 
> Thanks a lot,
> Attila
> 
> 
> 
> 
> ==============
> 1.)
> ==============
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/IO/itkIOCommonTest.cxx",
> line 47: Error: The function "strcpy" must have a
> prototype.
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/IO/itkIOCommonTest.cxx",
> line 54: Error: The function "strcpy" must have a
> prototype.
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/IO/itkIOCommonTest.cxx",
> line 77: Error: The function "strcpy" must have a
> prototype.
> 
> had to #incluce <string.h>
> (dunno why <cstring> wasn't enough)
> 
> ==============
> 2.)
> ==============
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/vxl/core/vnl/tests/test_bignum.cxx",
> line 370: Error: hex is not a member of std.
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/vxl/core/vnl/tests/test_bignum.cxx",
> line 371: Error: dec is not a member of std.
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/vxl/core/vnl/tests/test_bignum.cxx",
> line 379: Error: hex is not a member of std.
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/vxl/core/vnl/tests/test_bignum.cxx",
> line 380: Error: dec is not a member of std.
> 4 Error(s) detected.
> 
> had to #include <ios>
> 
> ==============
> 3.)
> ==============
> [ 90%] Building CXX object
> Testing/Code/Common/CMakeFiles/itkCommonTests.dir/itkHashTableTest.o
> cd
> /ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Testing/Code/Common
> && /ufsbckp2/Studio/solstudioex1006/bin/CC 
>   -library=stdcxx4 -m64   -mt -xO3
> -DNDEBUG -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/Algorithms
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/BasicFilters
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/Common
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/Numerics
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/IO
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/Numerics/FEM
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/Numerics/NeuralNetworks
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/SpatialObject
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/MetaIO
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/NrrdIO
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities/NrrdIO
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/DICOMParser
> 
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities/DICOMParser
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities/expat
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/expat
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/nifti/niftilib
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/nifti/znzlib
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/itkExtHdrs
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/vxl/v3p/netlib
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/vxl/vcl
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/vxl/core
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities/vxl/v3p/netlib
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities/vxl/vcl
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities/vxl/core
> 
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Utilities/gdcm
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Utilities/gdcm/src
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/Review
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight/Code/Review/Statistics
> -I/ssd1/studio.ex-apache/Slicer3-lib/Insight-build/Testing
> -o CMakeFiles/itkCommonTests.dir/itkHashTableTest.o -c
> /ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 50: Error: Formal argument key of type const int&
> in call to itk::hash_set<const char*, itk::hash<const
> char*>, eqstr, std::allocator<char>>::find(const
> int&) const is being passed const char*.
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 75: Error: Could not find a match for
> itk::hash_set<const char*, itk::hash<const char*>,
> eqstr, std::allocator<char>>::insert(const char[5])
> needed in itkHashTableTest(int, char**).
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 76: Error: Could not find a match for
> itk::hash_set<const char*, itk::hash<const char*>,
> eqstr, std::allocator<char>>::insert(const char[5])
> needed in itkHashTableTest(int, char**).
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 77: Error: Could not find a match for
> itk::hash_set<const char*, itk::hash<const char*>,
> eqstr, std::allocator<char>>::insert(const char[6])
> needed in itkHashTableTest(int, char**).
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 78: Error: Could not find a match for
> itk::hash_set<const char*, itk::hash<const char*>,
> eqstr, std::allocator<char>>::insert(const char[6])
> needed in itkHashTableTest(int, char**).
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 79: Error: Could not find a match for
> itk::hash_set<const char*, itk::hash<const char*>,
> eqstr, std::allocator<char>>::insert(const char[8])
> needed in itkHashTableTest(int, char**).
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 80: Error: Could not find a match for
> itk::hash_set<const char*, itk::hash<const char*>,
> eqstr, std::allocator<char>>::insert(const char[7])
> needed in itkHashTableTest(int, char**).
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 93: Error: Could not find a match for
> itk::hash_set<const char*, itk::hash<const char*>,
> eqstr, std::allocator<char>>::insert(const
> char[11]) needed in itkHashTableTest(int, char**).
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 94: Error: Formal argument key of type const int&
> in call to itk::hash_set<const char*, itk::hash<const
> char*>, eqstr,
> std::allocator<char>>::count(const int&) const
> is being passed const char[6].
> "/ssd1/studio.ex-apache/Slicer3-lib/Insight/Testing/Code/Common/itkHashTableTest.cxx",
> line 95: Error: Formal argument key of type const int&
> in call to itk::hash_set<const char*, itk::hash<const
> char*>, eqstr, std::allocator<char>>::find(const
> int&) const is being passed const char[5].
> 10 Error(s) detected.
> *** Error code 2
> 
> 
>       
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information
> visit:
> http://kitware.com/products/protraining.html
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
> 


      


More information about the Insight-developers mailing list