[Insight-users] Compile problems - Red Hat Enterprise WS-3; c
make 2.0.2 ; ITK from CVS ; DICOM parser subdirectory
Miller, James V (Research)
millerjv at crd.ge.com
Fri Jul 2 13:20:42 EDT 2004
This is a bit strange. The DICOM_NO_STD_NAMESPACE should have been
commented out for the compiler you are using. This flag is set
by CMake. From the Insight/Utilities/DICOMParser/CMakeLists.txt file
INCLUDE(${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake)
SET(DICOM_NO_STD_NAMESPACE ${CMAKE_NO_STD_NAMESPACE})
So, CMake should be testing whether the compiler has an std:: namespace
or not. One of your messages indicated that you were having problems
installing CMake. Does the TestForSTDNamespace.cmake module exist in
${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake
Jim
-----Original Message-----
From: Atwood, Robert C [mailto:r.atwood at imperial.ac.uk]
Sent: Friday, July 02, 2004 12:17 PM
To: Miller, James V (Research)
Cc: Insight-users (E-mail)
Subject: RE: [Insight-users] Compile problems - Red Hat Enterprise WS-3;
cmake 2.0.2 ; ITK from CVS ; DICOM parser subdirectory
Jim:
Yes, here is the information (plus the command I used to echo it)
I can see that this differes from the same file on another system where
I have previously compiled the ITK (a while ago) ,ie. the
DICOM_NO_STD_NAMESPACE is not defined in the other system, it is
commented out.
Thanks
Robert
sh-2.05b# cat DICOMCMakeConfig.h
#ifndef __DICOMCMakeConfig_h_
#define __DICOMCMakeConfig_h_
/* #undef DICOM_DLL */
/* #undef DICOM_STATIC */
#define DICOM_ANSI_STDLIB
#define DICOM_NO_STD_NAMESPACE
#define DICOMPARSER_NAMESPACE itkdicomparser
#endif
sh-2.05b#
-----Original Message-----
From: Miller, James V (Research) [mailto:millerjv at crd.ge.com]
Sent: 02 July 2004 16:39
To: Atwood, Robert C; Insight-users (E-mail)
Subject: RE: [Insight-users] Compile problems - Red Hat Enterprise WS-3;
cmake 2.0.2 ; ITK from CVS ; DICOM parser subdirectory
Robert,
In your build tree, is there a file under Utilities/DICOMParser called
DICOMCMakeConfig.h?
Can you send us the contents of that file?
Jim
-----Original Message-----
From: Atwood, Robert C [mailto:r.atwood at imperial.ac.uk]
Sent: Friday, July 02, 2004 10:57 AM
To: ITK Users (E-Mail)
Subject: RE: [Insight-users] Compile problems - Red Hat Enterprise WS-3;
cmake 2.0.2 ; ITK from CVS ; DICOM parser subdirectory
Original message attatchemnts were too big for the list, here are just
the initial make output and only the cvs tags for the entries related to
DICOM
-----Original Message-----
From: Atwood, Robert C
Sent: 02 July 2004 14:48
To: 'Luis Ibanez'
Cc: ITK Users (E-Mail)
Subject: RE: [Insight-users] Compile problems - Red Hat Enterprise WS-3;
cmake 2.0.2 ; ITK from CVS ; DICOM parser subdirectory
Example error message:
Building object file DICOMFile.o...
In file included from
/sources/local/ITK_cvs/Utilities/DICOMParser/DICOMFile.cxx:29:
/sources/local/ITK_cvs/Utilities/DICOMParser/DICOMFile.h:51: error:
parse error
before `&' token
(several more like this)
OKAY! OKAY! I am beginning to hate C++ already. Give me plain C!
>You should *NEVER* use "using namespace std;"
I said it 'might' be solved this way... not that it 'should' be solved
this way :-).
sh-2.05b# grep -r 'using namespace std' *
Code/Algorithms/itkGradientDifferenceImageToImageMetric.txx:using
namespace std;
Code/Common/itkWindowedSincInterpolateImageFunction.txx:using namespace
std; ... Someone uses this method...
The version of ITK, as I mentioned in the subject, was checked out via
anonymous CVS. This was originally done yesterday (July 1 2004) CVS
status results attatched for more detail. This was created with
cvs upd -C
cvs status > itk_version.txt
(so the examples are with TODAY's cvs July 2 2004 but there is no change
in the results)
I had some other problems to do with updating the previous checkout and
recompiling, I am not yet sure if it is a cmake issue or just me doing
something incorrect. However, ignoring this, I just checked out a whole
fresh tree which I called ITK_cvs, and created a fresh new build
directory which I called ITK_build
I used:
cd ITK_build
ccmake ../ITK_cvs
BUILD_EXAMPLES ON
BUILD_SHARED_LIBS ON
BUILD_TESTING ON
CMAKE_BACKWARDS_COMPATIBILITY 2.0
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /usr/local/encap/ITK-1.8.0.4
[c]
[g]
make >& make_output.txt
make clean
make -k >make_k_output.txt
(-k to 'keep going' after the error, to find more errors
These files, itk_version.txt, make_output.txt, and make_k_output.txt are
attatched and contain all the error messages Here is the first one,
there are many more.
Building object file DICOMFile.o...
In file included from
/sources/local/ITK_cvs/Utilities/DICOMParser/DICOMFile.cxx:29:
/sources/local/ITK_cvs/Utilities/DICOMParser/DICOMFile.h:51: error:
parse error
before `&' token
The ccmake problem is that the process did not seem to honour a new
CMAKE_INSTALL_PREFIX set via ccmake, for an updated version; ie
ccmake
...
CMAKE_INSTALL_PREFIX /usr/local/encap/ITK-1.8.0.4
...
[c]
[g]
make
make install
just installed into the last prefix I had set a while ago
(/usr/local/encap/ITK-1.8.0.2) Fortunately I still have the base
ITK-1.8.0 (I use 1.8 for cvs checkouts of the head revision that are
later than the 1.6, and .0.n for each time I check out from CVS and
recompile and install but this may not be consistent with your usage,
please see the itk_version.txt file for the cvs revision numbers of
specific files)
Now I cannot tell if ccmake 2.0.2 does this or not because I have not
managed a successful build of ITK after upgrading the ccmake
Robert
-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Sent: 01 July 2004 21:25
To: Atwood, Robert C
Cc: ITK Users (E-Mail)
Subject: Re: [Insight-users] Compile problems - Red Hat Enterprise WS-3;
cmake 2.0.2 ; ITK from CVS ; DICOM parser subdirectory
Hi Robert,
Please *NEVER* open namespaces !
That defeats the purpose of using namespaces.
You should *NEVER* use
"using namespace std;"
or
"using namespace itk;"
Please post the errors messages that you are getting.
If the compiler is complainng about "string", the real
solution is to specify its namespace like
std::string
instead of opening the namespace and exposing all the
symbols
In what version of ITK are you encountering this problem ?
Please let us know.
Thanks
Luis
-----------------------
Atwood, Robert C wrote:
> Dear ITK folks
>
> I get several messages due to the compiler not recognizing the
> 'string' macro/datatype/whatever it is; this might be solved by
> putting
>
> using namespace std;
>
> into the top of several files in the Utilities/DICOMParser .
>
>
> Here are some details (I tried using ccmake 1.8 first, then upgraded
> to see if that was the problem)
>
> sh-2.05b# ccmake --version
> ccmake version 2.0.2
>
> sh-2.05b# rpm -q glibc
> glibc-2.3.2-95.20
>
> sh-2.05b# rpm -q gcc
> gcc-3.2.3-24
>
>
> I seem to recall having this problem before, but I cannot remember if
> it was with this (ITK) or some other software package..I think it also
> has something to do with the level of gcc or glibc ?
>
> Robert
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list