[Insight-users] Build errors during ImageViewer application

Luis Ibanez luis . ibanez at kitware . com
Thu, 04 Sep 2003 18:37:40 -0400


Hi Sandy,

Here are step by step instructions for building the Applications.
I'm assuming you will build them all, so you will need FLTK and
VTK as additional libraries.

0) Download CMake 1.6.7
1) Download VTK 4.2
2) Download FLTK 1.1.4

3) Decided what compiler you are going to use.
     and if you are on windows decide if you want
    a build for debug or release.  You MUST build
   everything using the same compiler and the same
   compilation mode.  
   You probably want to do it for release, since the
   performance of many ITK will increase considerably
   in this mode.

4)  Take a deep breath

5) Configure VTK using CMake.
     Make sure to enable:

     VTK_USE_HYBRID
     VTK_USE_ANSI_STDLIB

6)  Build VTK in the compiler mode you choose
     (probably "Release").

7)  Build FLTK using the same compiler
     and the same compilation mode. FLTK
     does not use CMake for configuration
     (we all hope that it will do one day and
      relief us from many headaches).

8)  Configure ITK with CMake.
     Note that you could disable TESTING and
      EXAMPLES. In that way the build process
      will take only 15 minutes.

9)   Build ITK using the same compiler
       and compilation mode that you used
       for FLTK and VTK.


10)  Configure InsightApplications with CMake.
       
       For VTK_DIR provide the binary directory
       where you build VTK

      For FLTK you should provide the following
      variables

FLTK_BASE_LIBRARY
FLTK_FLUID_EXECUTABLE
FLTK_FORMS_LIBRARY
FLTK_GL_LIBRARY
FLTK_IMAGES_LIBRARY
FLTK_INCLUDE_DIR

      Note that if you only provide
      FLTK_INCLUDE_DIR and
      FLTK_FLUID_EXECUTABLE
      CMake will figure out the others for you.

FLTK_FLUID_EXECUTABLE must have to the
full path to the fluid.exe executable that you will
find in the /fluid subdirectory of your FLTK built.

FLTK_INCLUDE_DIR must have the directory
were you copied FLTK when you start to build it.
NOTE that it SHOULD NOT include the directory
/Fl where the headers are.
This is because all FLTK code use  #include <Fl/Fl_Foo.h>


11) At this point, after clicking in the Configure
      button you should not get any new "red" undefined
      variables.


12) Click Ok in CMake, the VC++ project files will
      be generated in the binary directory that you selected
      during the configuration process.

13) I hope you are not supersticious....
      because here is where you take your compiler
     and open the project file. Make sure that you select
     the same compilation mode (Debug,... Release...).
     And start building ...
     
14)  The process of building VTK and InsightApplications
     will give you time for coffee...



Enjoy ITK !


     Luis


-----------------------
Sandy April wrote:

> Hi Luis,
> Can you tell me how to configure cmake for insight application. I want 
> to use fltk and vtk..how do I do that.what should I specify for 
> vtk_dir. Thank you
>
> */Luis Ibanez <luis . ibanez at kitware . com>/* wrote:
>
>     Hi Sandy,
>
>     It is better to keep InsightApplications in a separate folder from
>     Insight.
>     CMake allow you to select any directory. Simply create a binary
>     directory
>     for building InsightApplications, and when you configure with CMake,
>     provide both the Source and Binary directories for
>     InsightApplications.
>
>     You will be prompted for the ITK_DIR directory (where you built ITK),
>     and then you will have options for selecting FLTK and VTK.
>
>     Please let us know if you find any problem,
>
>
>     Thanks
>
>
>     Luis.
>
>
>     ----------------------
>     Sandy April wrote:
>
>     > Hi Luis,
>     > Sorry I needed to confirm again.I have downloaded Insight toolkit,
>     > cmake in a folder called itk.I have created a folder BITK in
>     that as a
>     > binary folder.I did setup cmake for Insight toolkit and BITK. I was
>     > able to run itk. Now I was t! rying to run insight
>     applications.should I
>     > include this insight application folder in Insight toolkit
>     folder or
>     > should I be having the application as a seperate folder in itk
>     > directory and setup cmake for the application. Please guide me
>     through
>     >
>     > */Luis Ibanez /* wrote:
>     >
>     >
>     > Hi Sandy,
>     >
>     >
>     > Your configuration is missing to link with ITK libraries.
>     >
>     > Did you configure InsightApplications using CMake ?
>     >
>     > Did you run CMake at the top level of the InsightApplication
>     > directory ? (not in one of the subdirectories).
>     >
>     > Did you provide the binary directory where you built ITK ?
>     >
>     >
>     >
>     > Luis
>     >
>     >
>     >
>     > --------------------
>     > Sandy Gowda wrote:
>     > > Hi,
>     > > I have tried to run ImageViewer application. There were no
>     > compilation
>     > > error when I try to execute ! it gave me following errors. It
>     gave 90
>     > > errors but I am attaching some errors. Please let me know what I
>     > should do.
>     > >
>     > > --------------------Configuration: itkImageViewer - Win32
>     > > Debug--------------------
>     > > Linking...
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > "public:
>     > > static void ! __cdecl itk::LightObject::operator delete(void *)"
>     > > (??3LightObject at itk@@SAXPAX at Z )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > "public:
>     > > static void * __cdecl itk::LightObject::operator new(unsigned
>     int)"
>     > > (??2LightObject at itk@@SAPAXI at Z )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > "public:
>     > > static class itk::SmartPointer __cdecl
>     > > itk::ObjectFactoryBase::CreateInstance(char const *)"
>     > > (?CreateInstance at ObjectFactoryBase@itk@@SA?AV?$SmartPointer
>     > >
>     > > @VLightObject at itk@@@2 at PBD@Z)
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > > "protected: class itk::DataObject * __thiscall
>     > > itk::ProcessObject::GetOutput(unsigned int)"
>     > > (?GetOutput at ProcessObject@itk@@IAEPAVDataObj! ect at 2@I at Z
>     > > )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > > "protected: virtual void __thiscall
>     > > itk::ProcessObject::PropagateResetPipeline(void)"
>     > > (?PropagateResetPipeline at ProcessObject@itk@@MAEXXZ
>     > > )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > > "protected: virtual void __thiscall
>     > > itk::ProcessObject::RemoveOutput(class itk::DataObject *)"
>     > > (?RemoveOutput at ProcessObject@itk@@MAEXPAVDataObject at 2@@Z
>     > > )
>     > > itkImageViewer.obj : error LNK200! 1: unresolved external symbol
>     > > "protected: virtual void __thiscall
>     > itk::ProcessObject::AddOutput(class
>     > > itk::DataObject *)"
>     > > (?AddOutput at ProcessObject@itk@@MAEXPAVDataObject at 2@@Z
>     > > )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > > "protected: virtual void __thiscall
>     > > itk::ProcessObject::SetNthOutput(unsigned int,class
>     > itk::DataObject *)"
>     > > (?SetNthOutput at ProcessObject@itk@@MAEXIPAVDataObject at 2@@Z
>     > > )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > > "protected: virtual void __thiscall
>     > > itk::ProcessObject::GenerateOutputRequestedRegion(class
>     > itk::DataObject
>     > > *)"
>     > >
>     >
>     (?GenerateOutputRequestedRegion at ProcessObject@itk@@MAEXPAVDataObject at 2@@Z
>     >
>     > > )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > > "protec! ted: virtual void __thiscall
>     > > itk::ProcessObject::GenerateInputRequestedRegion(void)"
>     > > (?GenerateInputRequestedRegion at ProcessObject@itk@@MAEXXZ
>     > > )
>     > > itkImageViewer.obj : error LNK2001: unresolved external symbol
>     > > "protected: virtual void __thiscall
>     > > itk::ProcessObject::RemoveInput(class itk::DataObject *)"
>     > > (?RemoveInput at ProcessObject@itk@@MAEXPAVDataObject at 2@@Z
>     > > )
>     > > Can anybody help me. I dont know whether I am doing anything
>     > wrong if
>     > > anybody can let me know how to go by using insight application
>     > it would
>     > > really help.If i have to use fltk should I download in the same
>     > folder
>     > > as insight toolkit and should I use cmake for that. Please let
>     > me know.
>     > > Thank you
>     > >
>     > >
>     >
>     ------------------------------------------------------------------------
>     > > Do you Yahoo!?
>     ! > > Yahoo! SiteBuilder
>     > > - Free,
>     > > easy-to-use web site design software
>     >
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     > Do you Yahoo!?
>     > Yahoo! SiteBuilder
>     > -
>     > Free, easy-to-use web site design software
>
>
>
>
>
>     _______________________________________________
>     Insight-users mailing list
>     Insight-users at itk . org
>     http://www . itk . org/mailman/listinfo/insight-users
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder 
> <http://us . rd . yahoo . com/evt=10469/*http://sitebuilder . yahoo . com> - 
> Free, easy-to-use web site design software