[Insight-users] building error : CC and CXX must be set before running ccmake.

Luis Ibanez luis . ibanez at kitware . com
Wed, 15 Oct 2003 23:40:04 -0400


Hi Bing,


Thanks for sending your CMakeCache.txt file.

Here is the source of your problem:

    //C++ compiler
    CMAKE_CXX_COMPILER:STRING=c++

You are invoking "c++" as the C++ compiler. This
is not bad in itself, the problem is that the same
is later used as the C++ linker.

You should be using "g++" instead of "c++".

Before running "ccmake", please set the CC and CXX
environment variables like:

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

or

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

depending on the shell that you are using.


Please wipe out the binary directory
before you do this configuration.


Regards,


   Luis


--------------------------
Bing Jian wrote:
> Hi, Luis,
> 
>   OK. Here are some info about 1), 2), 3):
> 
>   1) gcc version:
> [itk at sm0-19 Insight-binary]$ gcc -v
> Reading specs from
> /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/specs
> Configured with: ../configure --prefix=/usr --libdir=/usr/lib
> --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
> --enable-shared --enable-threads=posix --disable-checking
> --enable-long-long --enable-__cxa_atexit
> --enable-languages=c,c++,ada,f77,objc,java,pascal
> --host=i586-mandrake-linux-gnu --with-system-zlib
> Thread model: posix
> gcc version 3.3.1 (Mandrake Linux 9.2 3.3.1-1mdk)
> 
>  2) CC and CXX
>  I did not set those environment variables. echo $CC and echo $CXX
> give blank.
> 
>  3) CMakeCache.txt
>  this file is more than 46k. (I included everything, examples and
> testing in configuration) I guess it is too large for posting
> to this mailling list. I will only send it to you.
> 
>  Thanks!
> 
> 
>  -- Best wishes, Bing
> Jian bjian at cise . ufl . edu
> 
> 
> On Wed, 15 Oct 2003, Luis Ibanez wrote:
> 
> 
>>
>>Hi Bing,
>>
>>The Dashboard is green today.
>>http://www . itk . org/Testing/Dashboard/20031015-0500-Nightly/Dashboard . html
>>
>>The problem in your build must be related to your
>>local configuration.
>>
>>Please give us some details regarding your system:
>>
>>  1) What version of gcc are you using ?
>>
>>  2) Did you set up the environment variables CC and CXX
>>     before running ccmake ?
>>
>>  3) Please post the CMakeCache.txt file created by CMake
>>     in the ITK binary directory.
>>
>>The error you get appears during the linking phase of
>>the tests. It looks like the wrong linker is being used.
>>It could be that you are mixing two version of
>>gcc, or that the environment variables CC and CXX
>>are not pointing to the correct executables gcc and g++.
>>
>>
>>Please let us know about (1),(2),(3).
>>
>>
>>Thanks
>>
>>
>>    Luis
>>
>>
>>
>>------------------
>>Bing Jian wrote:
>>
>>>Hi,
>>>    I just tried to install itk onto a new bought machine
>>>with mandrake 9.2. The Insight package was checked out tonight
>>>via CVS. I did it same way as I did before on SunOS: ccmake
>>>configure, generate Makefile and then type make.  But this
>>>time I got following errors during process of make.
>>>
>>>Building executable /home/itk/Insight-binary/bin/itkCommonTests...
>>>itk::SmartPointer<itk::ImportImageContainer<unsigned long,
>>>itk::Vector<float, (unsigned)3> > >::operator->() const: discarded in
>>>section
>>>`.gnu.linkonce.t._ZNK3itk12SmartPointerINS_20ImportImageContainerImNS_6VectorIfLj3EEEEEEptEv'
>>>from itkVectorToRGBImageAdaptorTest.o
>>>collect2: ld returned 1 exit status
>>>make[7]: *** [/home/itk/Insight-binary/bin/itkCommonTests] Error 1
>>>make[6]: *** [default_target] Error 2
>>>make[5]: *** [default_target_Common] Error 2
>>>make[4]: *** [default_target] Error 2
>>>make[3]: *** [default_target_Code] Error 2
>>>make[2]: *** [default_target] Error 2
>>>make[1]: *** [default_target_Testing] Error 2
>>>make: *** [default_target] Error 2
>>>
>>>Anything wrong? Thanks!
>>>
>>
>>
>>
>>
>>
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>