[Insight-users] Re: Build problem

Zhuang Song (Johnny) songz at seas . upenn . edu
Tue, 18 Nov 2003 17:13:03 -0500


Hi Gavin,
Thanks for the help. I have successfully built ITK itself. The only
difference than your steps is that I created the build directly inside
the source directory of InsightToolkit. Does this really matter? 

The major problem was I only set the path for C++ compiler, but didn't
set that for C compiler. After I fixed this problem, the whole build
process for ITK itself had no error or warning message. But when I
compile my own program, the compiler still can't understand C++ syntax,
such like the definition of vector variables:
           const vector< int >::iterator  iterator_x,
           const vector< int >::iterator  iterator_y,
it will give error message:
   parse error before `::' token
   'vector' undeclared (first use this function)

It seems C++ compiler still doesn't work. or is there other
configuration problem?

thanks,
Zhuang




On Mon, 2003-11-17 at 22:50, Gavin Baker wrote:
> Hello Zuang,
> 
> On Mon, Nov 17, 2003 at 01:40:42PM -0500, Zhuang Song wrote:
> 
> > I've tried several times to download ITK 1.4 tar file or use CVS, and
> > then built it. It can't complete the make process for ITK itself. The
> > error message is shown below.
> > 
> > make[7]: *** [Templates/vnl_vector+long_double-.o] Error 1
> >
> > [...snip...]
> 
> Something fundamental has gone wrong here.  I suggest you start with the
> released 1.4 version of ITK, at least to begin with.  I also suggest you
> have a read through the most excellent ITK Software Guide (available for
> purchase or download at the main ITK website).  Chapter 2 contains quite
> some detail on how to compile and install ITK.
> 
> The build process is quite straightforward.  First, make sure you have a
> recent version of CMake (1.8).  Start from a fresh clean directory.  Then
> you should be able to do something like:
> 
> % tar xfz ~/Downloads/InsightToolkit-1.4.0.tar.gz
> % mkdir itk-linux
> % cd itk-linux
> % ccmake ../InsightToolkit-1.4.0
> 
> In this way you can keep the source tree separate from the build tree.  The
> final command will invoke the interactive CMake program to configure paths
> and options.
> 
> Then make sure everything gets configured properly.  In particular, on Unix
> you should enable using the system zlib, png, and so on.  To speed things
> up, I suggest you also disable BUILD_TESTING and BUILD_EXAMPLES, but enable
> BUILD_SHARED_LIBS.
> 
> Make sure that the compiler is set correctly (use 't' to view the advanced
> options), as your message indicated a problem there.  The C++ compiler is
> set by CMAKE_CXX_COMPILER, and should be either 'c++' or 'g++' depending on
> your system.  Similarly, CMAKE_C_COMPILER should be either 'cc' or 'gcc'
> depending on your system.
> 
> After configuring with 'c' is complete, you can use 'g' to generate the
> Makefiles.  Then just run the build:
> 
> % make
> 
> This will take a while...
> 
> There are lots of good docs on the ITK website, including tutorials and
> getting started info at:
> 
>   http://www . itk . org/HTML/Tutorials . htm
> 
> If you are still having further problems, we would need to see what commands
> you ran prior to getting the errors you pasted (above).
> 
> Good luck...
> 
>   :: Gavin
-- 
Johnny