[Insight-users] Re: Build problem
Gavin Baker
gavinb+xtk at cs . mu . OZ . AU
Wed, 19 Nov 2003 10:39:59 +1100
Hello,
On Tue, Nov 18, 2003 at 05:13:03PM -0500, Zhuang Song (Johnny) wrote:
> 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?
No, it doesn't matter where you put the build directory. It is just
preferrable to keep it separate from the source directory (for upgrades
etc).
> 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.
Great!
> 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?
That looks more like there's just a missing #include <vector>. It is hard
to tell without seeing the rest of the code or how you are building it. Are
you using CMake? That makes building things _much_ easier...
After you have done a 'make install', use the sample found in:
InsightToolkit-1.4.0/Examples/Installation
to test your installation. Just copy HelloWorld.cxx and CMakeLists.txt
somewhere else, and build that. Be sure to set ITK_DIR to point to wherever
you installed it (eg. /usr/local/lib/itk).
If that doesn't work, we will need to see more detail to know what went
wrong. There is more discussion of this in Chapter 2 of the ITK Software
Guide.
:: Gavin
--
Gavin Baker Complex Systems Group
http://www . cs . mu . oz . au/~gavinb The University of Melbourne