This question was originally posted on the bug forum by accident.  Sorry for 
the inconvenience if any.


I am trying to put textures on buttons.  I started with 'buttons.cxx' from the 
fltk 'test' directory.  The FLTK distribution test programs compile and run.  
When I compile/link buttons.cxx from outside the FLTK directory, I get a link 
error as follows:

xpmFileImage.cxx ...: undefined reference to fltk::xpmImage::fetch(fltk...)

In order to eliminate the link error, I have to include the xpmFileImage.cxx as 
part of my own source code.  Am I missing something?  I would think that 
xpmFileImage would be in an FLTK library that I could link against so that I 
don't have to mix FLTK source code with my own source code.

I'm running Suse 10.3, FLTK 2.0.x-r6059.

In the "button.cxx' example in the FLTK 'test' distribution directory,  The 
call to 'register_images' in the code below is what references 
'xpmImage::fetch'.  My code follows;

playBook::playBook()
{

   register_images();

   pbWindow = new Window(win_posx, win_posy, CNS_WINDOW_WIDTH, 
CNS_WINDOW_HEIGHT-200, "Play Book Control");
   pbWindow->begin();

   Group* o = mGroup = new Group( 10, 10, COMMS_GROUP_WIDTH, PB_GROUP_HEIGHT );
   o->begin();
     o->box(EMBOSSED_BOX);
     o->image(new TiledImage(SharedImage::get("/usr/local/src/ 
fltk-2.0.x-r6059/test/images/bg.jpeg")));
     pbWindow->resizable(o);
   o->end();
   pbWindow->end();
}

In order to get this code to link, I have to include

/usr/local/src/fltk-2.0.x-r6059/images/xpmFileImage.cxx in my source code.  I 
am including the following libraries.  I would have thought xpmFileImages to be 
in one of them.

-lX11 -lXi -lXinerama -lXft -lm -lXext -lsupc++ -lGLU -lGL -lfltk2 -lfltk2_gl 
-lutility -lnetwork -lpng -lfltk2_images -ljpeg -lz -lXft -lpthread

Is there a library I am missing, or do I need to include xpmImageFile.cxx in my 
source to link successfully?  Or perhaps the order of the link libraries is 
critical?

Thanks much.


tm
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to