[Insight-users] Installation build errors

Luis Ibanez luis.ibanez@kitware.com
Sun, 17 Nov 2002 21:26:51 -0500


Hi Neil,

It is unlikely that the problems you reported
with the compiler are due to namespaces and
heavy typedefs...
It's true that ITK has a lot of them   :-)
but this shouldn't disturb the compiler.

This rather looks like a compiler configuration
problem.

According to your error message, you are using
"gcc" to compile C++ code. That means that
your "CC" and "CXX" environment variables were
not correctly configured before you ran CMake.

Please make sure that CC points to "gcc" and
CXX points to "g++". Depending on your shell
this may require a command like:

     export CC=/usr/bin/gcc
     export CXX=/usr/bin/g++

or

      setenv CC    /usr/bin/gcc
      setenv CXX   /usr/bin/g++


Make sure that both compilers correspond to the
same version (2.95) or (3.1.1).

verify this with

    gcc --version
    g++ --version


Take also into account that "gcc" doesn't know
how to invoke the linker for C++ programs.
A missconfiguration of the CC and CXX environment
variables will result in using the wrong linking
options for the language.

If you continue experiencing problem, could you
please post your CMakeCache.txt file ?

This file is generated by CMake and put in the
Binary directory where you are building ITK.


    Thanks

       Luis


========================================

Neil Killeen wrote:

>>
>>
> 
> well i have yet to get the whole system to build.  as
> i indicated, I resolved those linking errors.  However,
> I am now encountering another compile  error.
> 
> This is occurring in many files, but the first is when executing
> 
> #!/bin/csh
> gcc -ftemplate-depth-50 -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Testing/Code/Common  \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/Algorithms \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/BasicFilters \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/Common \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/Numerics \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/IO \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/Numerics/FEM \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/Numerics/Statistics \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/build/Code/Numerics/vxl \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/Numerics/vxl \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/build/Code/Numerics/vxl/vcl \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/Numerics/vxl/vcl \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Code/SpatialObject \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Utilities/png \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Utilities/zlib \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Utilities/MetaIO \
> -I/DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/build \
> -c
> /DATA/ELARA_3/nkilleen/itk/InsightToolkit-1.0.0/Testing/Code/Common/itkDynamicMeshTest.cxx \
> -o itkDynamicMeshTest.o
> 
> 
> 
> The error actually comes from the assembler, and is
> 
> 
> /usr/ccs/bin/as: "/var/tmp/ccZyzg8T.s", line 9410: error: can't compute
> value of an expression involving an external symbol
> 
> Ack !  I don't rightly no what symbol in the C++ is upsetting it.
> 
> I have tried various fiddlings about with the code to see if I could
> resolve this.
> 
> The first few lines, after all the typedefs, are
> 
> int itkDynamicMeshTest(int, char**)
> {
> 
>   /**
>    * Create the mesh through its object factory.
>    */
> 
> 
>   MeshType::Pointer mesh(MeshType::New());
> 
> 
> 
> If I comment out all of the contents except this one remaining line the
> error still occurs.  If I comment out  this line as well, the error
> goes away (as you might expect), but at least it indictaes the typedef
> definitions get through ok.
> 
> I have tried replacing this line with one without the typedefs, but
> to no avail (same error).
> 
> I found however, that gcc-3.1.1 does compile this factory class ok.
> 
> So presently I am stuck with the fact that the gcc-3.1.1 build I tried
> earlier failed with templating errors, and the gcc-2.95.3 is failing
> with the above error  :-(
> 
> I don't know if there are some switched for 2.95.3 that might help.
> But fundamentally, I don't know why its unhappy.  Possibly some
> combination of namespaces and heavy typedef-ing.
> 
> Any thoughts ?
> 
> Perhaps I will try again to get 3.1.1 going...
> 
> cheers
> Neil
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
> 
>