[Insight-users] fltk link errors : Please use CMake

Luis Ibanez luis . ibanez at kitware . com
Thu, 02 Oct 2003 11:23:15 -0400


Hi Bing,


        Please use CMake !



The linking problems you are facing
are the result of poor configuration.

The real solution is to use CMake for
configuring your project. It will require
only 10 lines of CMake commands to get
this done correctly.

There are more fun things to do in life
than tweaking libraries in the Visual
Studio GUI.  Using CMake will allow you
to get time for those other fun things.

You can start from the CMakeLists.txt
file attached to my previous email.
Simply remove the VTK and ITK sections.



Regards


    Luis



------------------
Bing Jian wrote:
> Hi Luis, Thanks for your help.
> 
> Those 2 programs I am currently in trouble have not used ITK so far.
> And I have no CMakeLists.txt. Now I just set the library path manually
> in Visual Studio IDE.
> 
> Like that program with displaying problem, if I use fltk, fltkforms,
> fltkimages, fltkgl library instead of fltkdll.lib, first I will get
> "MSVCRT" conflicts with use of other libs (LIBC.lib in this case
> while LIBCMT.lib in that one). After I solve conflicts, following
> errors  are still there
> 
> fltk.lib(Fl_x.obj) : error LNK2001: unresolved external symbol
> ___WSAFDIsSet at 8
> fltk.lib(Fl_x.obj) : error LNK2001: unresolved external symbol
> _select at 20
> fltk.lib(Fl_x.obj) : error LNK2001: unresolved external symbol
> __imp___TrackMouseEvent at 4
> Release/MITK.exe : fatal error LNK1120: 3 unresolved externals
> 
> The difference between this one and another one is that if I switch
> to fltkdll.lib, then I get
> 
> Linking...
> RegDataView.obj : error LNK2001: unresolved external symbol "public:
> static int Fl::e_keysym" (?e_keysym at Fl@@2HA)
> RegDataView.obj : error LNK2001: unresolved external symbol "public:
> static int Fl::e_y" (?e_y at Fl@@2HA)
> RegDataView.obj : error LNK2001: unresolved external symbol "public:
> static int Fl::e_x" (?e_x at Fl@@2HA)
> RegImageView.obj : error LNK2001: unresolved external symbol "public:
> static int Fl::e_clicks" (?e_clicks at Fl@@2HA)
> 
> As I mentioned before, I encountered same problem when I used
> fltk-1.1.2. Last time I fixed it by making modification to
> inline properties of those e_x e_y members in FL/fl.h.
> 
> Recently I upgraded to fltk-1.1.4, last time I got same problem
> when I tested itkfltkimageviewer demo program in InsightApplication.
> when linked with fltkdll.lib. But that time if I use fltk.lib
> fltkimages.lib fltkgl.lib fltkforms.lib, then it can pass and work.
> 
> So at that time I thought I won't need to modify FL/fl.h, but it seems
> there are still a lot of trouble about this issue. :-(
> 
>