[Insight-users] building Insight on win2k with VC++ 6

Luis Ibanez luis.ibanez@kitware.com
Thu, 16 May 2002 07:50:44 -0400


Hi Charlie,

Welcome to ITK !

The errors that you are getting are due to FLTK.

We have tried to stick with a pretty stable
version of FLTK instead of using the latest one.

The recomended version of FLTK to use with
ITK examples is version 1.0.11.

The reason for the error messages in your build
is that starting with version 1.1 FLTK divided
its library in two libraries. One with the
tradicional widgets (fltk.lib) and a second
library (fltkgl.lib) with OpenGL related
widgets (like the Fl_Gl_Window for example).

FLTK version 1.0.11 used a single library: "fltk.lib".
Our CMake projects are configured to link with the
single "fltk.lib" of version 1.0.11 and do not include
at all the "fltkgl.lib" file.

The result is that when you install version 1.1, all
the OpenGL related widgets are missing at link
time because ITK project doesn't try to link with
fltkgl.lib. Those are the "unresolved external symbol"
messages that you are getting.

Other people have encounter this problem before
and they have adapted the CMakeList.txt files to
be compatible with both versions of FLTK or at least
to run with FLTK 1.1.

Probably the person who knows better how to do it
is Julien Jomier at UNC (he could probably give you
new CMakeList.txt files).

If you are anxious for getting ITK running
(and I bet you are :-)


Here are two quick solutions:

1) Download FLTK 1.0.11, build it, and reconfigure
    ITK for using this version instead of the newest 1.1
    (it will be quite fast since fltk is very compact)

or

2) In Project settings, go to the tab "Link" and add
    fltkgl.lib to the list of libraries to link with.
    This second option is not that good because you
    will have to do it in *every* project that needs
    the library.



Note that ITK itself does not require FLTK at all.
The only reason why FLTK is used is to provide some
examples of who to write applications that interface
a GUI with ITK.

We look forward to migrate the examples to FLTK 1.1,
since this version have some new interesting
functionalities like the support for "themes" that
make desktop applications look uniform.


Please let us know if you encounter any other
problem

  Thanks


    Luis


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

Charlie H. Chang wrote:
> Hello all,
> I am new to ITK, and I have used VTK for a while.
> Recently I have tried to build ITK on won2k but fails them all.
> I have installed VTK 4.0 (CVS), fltk 1.1.0b13, and CMake 1.2;
> the following are the parameters and their values in CMake,
> then I included the error message.
> Can anyone see what goes wrong?
> Thank you in advance!
> 
> 
> - CMake info to build ITK -
> BUILD_AUXILIARY ON
> BUILD_EXAMPLES  ON
> BUILD_FEM_CODE ON
> BUILD_FLTKIMAGEVIEWER ON
> BUILD_METAIMAGE ON
> BUILD_TESTING ON
> BUILD_VTKINTERFACE ON
> EXECUTABLE_OUTPUT_PATH  c:/OPT/BIN
> FLTK_FLUID_EXE  C:/OPT/FLTK/FLUID.EXE
> FLTK_INCLUDE_PATH C:/OPT/FLTK
> FLTK_LIBRARY C:/OPT/FLTK/LIB/FLTK.LIB
> FLTK_WRAP_UI ON
> GLU_LIBRARY GLU32
> ...
> USE_BUILT_VTK ON
> USE_FLTK ON
> USE_VTK ON
> VTK_BINARY_PATH C:/OPT/VTK
> VTK_INSTALL_PATH NOTFOUND
> VW_RAW_DATA_PATH NOTFOUND
> 
> 
> - VC++ 6 message -
> 
> --------------------Configuration: ImageRegistration - Win32 
> Release--------------------
> Linking...
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "public: virtual void __thiscall 
> Fl_Gl_Window::resize(int,int,int,int)" (?resize@Fl_Gl_Window@@UAEXHHHH@Z)
> FltkImageViewer.lib(fltkImageViewerGUI.obj) : error LNK2001: unresolved 
> external symbol "public: virtual void __thiscall 
> Fl_Gl_Window::resize(int,int,int,int)" (?resize@Fl_Gl_Window@@UAEXHHHH@Z)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "private: virtual void __thiscall 
> Fl_Gl_Window::draw_overlay(void)" (?draw_overlay@Fl_Gl_Window@@EAEXXZ)
> FltkImageViewer.lib(fltkImageViewerGUI.obj) : error LNK2001: unresolved 
> external symbol "private: virtual void __thiscall 
> Fl_Gl_Window::draw_overlay(void)" (?draw_overlay@Fl_Gl_Window@@EAEXXZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "public: virtual void __thiscall Fl_Gl_Window::hide(void)" 
> (?hide@Fl_Gl_Window@@UAEXXZ)
> FltkImageViewer.lib(fltkImageViewerGUI.obj) : error LNK2001: unresolved 
> external symbol "public: virtual void __thiscall 
> Fl_Gl_Window::hide(void)" (?hide@Fl_Gl_Window@@UAEXXZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "public: virtual void __thiscall Fl_Gl_Window::show(void)" 
> (?show@Fl_Gl_Window@@UAEXXZ)
> FltkImageViewer.lib(fltkImageViewerGUI.obj) : error LNK2001: unresolved 
> external symbol "public: virtual void __thiscall 
> Fl_Gl_Window::show(void)" (?show@Fl_Gl_Window@@UAEXXZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "public: virtual void __thiscall Fl_Gl_Window::flush(void)" 
> (?flush@Fl_Gl_Window@@UAEXXZ)
> FltkImageViewer.lib(fltkImageViewerGUI.obj) : error LNK2001: unresolved 
> external symbol "public: virtual void __thiscall 
> Fl_Gl_Window::flush(void)" (?flush@Fl_Gl_Window@@UAEXXZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "public: virtual __thiscall Fl_Gl_Window::~Fl_Gl_Window(void)" 
> (??1Fl_Gl_Window@@UAE@XZ)
> FltkImageViewer.lib(fltkImageViewerGUI.obj) : error LNK2001: unresolved 
> external symbol "public: virtual __thiscall 
> Fl_Gl_Window::~Fl_Gl_Window(void)" (??1Fl_Gl_Window@@UAE@XZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "private: void __thiscall Fl_Gl_Window::init(void)" 
> (?init@Fl_Gl_Window@@AAEXXZ)
> FltkImageViewer.lib(fltkImageViewerGUI.obj) : error LNK2001: unresolved 
> external symbol "private: void __thiscall Fl_Gl_Window::init(void)" 
> (?init@Fl_Gl_Window@@AAEXXZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "void __cdecl gl_draw(char const *,float,float)" 
> (?gl_draw@@YAXPBDMM@Z)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "double __cdecl gl_width(char const *)" (?gl_width@@YANPBD@Z)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "int __cdecl gl_height(void)" (?gl_height@@YAHXZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "void __cdecl gl_font(int,int)" (?gl_font@@YAXHH@Z)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "public: void __thiscall Fl_Gl_Window::ortho(void)" 
> (?ortho@Fl_Gl_Window@@QAEXXZ)
> liImageRegistrationConsole.obj : error LNK2001: unresolved external 
> symbol "public: void __thiscall Fl_Gl_Window::make_current(void)" 
> (?make_current@Fl_Gl_Window@@QAEXXZ)
> Release/ImageRegistration.exe : fatal error LNK1120: 13 unresolved externals
> Error executing link.exe.
> 
> ALL_BUILD - 21 error(s), 0 warning(s)
> 
> 
> 
> 
> 
> -- 
> Charlie H. Chang, Software Development Group
> National Center for High-performance Computing
> T: 1-886-3-5776085x362
> E: charlie.chang@nchc.gov.tw
> W: www.nchc.gov.tw