Jan 16, 2009 at 4:54pm UTC
Hi, Im coding a programme and would like to add an image to the main window and some of the widgets. I am using the fast light tool kit v 1.1.9. My code is as follows:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_PNG_Image.H>
#include <FL/Fl_Text_Display.H>
int main(int argc, char ** argv)
{
const char *dir = "./img/facia.png";
Fl_Window *window;
Fl_PNG_Image *facia;
facia = new Fl_PNG_Image(dir);
window = new Fl_Window(623, 464);
window->image(facia);
window->end();
window->show(argc, argv);
return(Fl::run());
}
The code returns the error:
[Linker error] Undefined reference to "Fl_PNG_Image::Fl_PNG_Image(char const*)"
Any solutions would be greatly appreciated
Jan 19, 2009 at 6:41pm UTC
Typically, undefined reference means you have not linked to the correct .lib/.a file when compiling.