[Insight-users] fltk link errors

Bing Jian bjian at cise . ufl . edu
Thu, 2 Oct 2003 11:10:59 -0400 (EDT)


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. :-(


-- 
Best wishes,
Bing Jian
bjian at cise . ufl . edu


On Thu, 2 Oct 2003, Luis Ibanez wrote:

>
> Hi Bing,
>
> Please post your CMakeLists.txt file.
>
> Your application must link to the four FLTK
> libraries
>
>      fltk
>      fltkforms
>      fltkimages
>      fltkgl
>
>
> You can add all of them to the
> TARGET_LINK_LIBRARIES command by using
> "FLTK_LIBRARIES"
>
>
> Please look at the attached CMakeLists.txt
> file for an example on how to do this.
>
> Note also the use of FIND_PACKAGE(FLTK)
>
>
>
> Regards,
>
>
>     Luis
>
>
> -----------------------
> Bing Jian wrote:
> > I sent this message to fltk.general mailling list
> > several days ago, but got no response so far. Hope
> > I can get some help from here. Thanks!
> >
> > Hello everyone,
> >
> >    I have trouble linking my program with fltk-1.1.4
> > in visual c++ 6.0 environment. No matter what configuaration
> > I choose, it always gives following errors:
> >
> > --------------------Configuration: MITK - Win32
> > Debug--------------------
> > Linking...
> > RegDataView.obj : error LNK2001: unresolved external symbol "public:
> > static int Fl::e_x" (?e_x 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_keysym" (?e_keysym at Fl@@2HA)
> > static int Fl::e_clicks" (?e_clicks at Fl@@2HA)
> > Debug/MITK.exe : fatal error LNK1120: 4 unresolved externals
> > Error executing link.exe.
> >
> > In release mode, I am using fltkdll.lib; In debug mode, I am using
> > fltkdlld.lib.  Is it right?
> > And what about fltk.lib and fltkgl.lib, fltkforms.lib, fltkimages.lib?
> >
> > Thanks in advance!
> >
>
>
>