LNK2019 Error FLTK

Hello, Can anyone help me with this error I keep getting I've searched around this forum but didn't see any specific help.

This is the code I'm trying to run. I've installed fltk correctly and am using Visual Studio .NET 2003

#include <FL/Fl.H>

#include <FL/Fl_Window.H>

#include <FL/Fl_Shared_Image.H>

#include <FL/Fl_JPEG_Image.H>

#include <FL/Fl_Box.H>

int main() {

fl_register_images(); // initialize image lib

Fl_Window win(720,486); // make a window

Fl_Box box(10,10,720-20,486-20); // widget that will contain image

Fl_JPEG_Image jpg("yarrrr.jpg"); // load jpeg image into ram

box.image(jpg); // attach jpg image to box

win.show();

return(Fl::run());

}

This results in the compiler error:

testprogram.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" ( 0Fl_JPEG_Image@@QAE@PBD@Z) referenced in function _main

testprogram.obj : error LNK2019: unresolved external symbol "void __cdecl fl_register_images(void)" ( fl_register_images@@YAXXZ) referenced in function _main

Debug/test.exe : fatal error LNK1120: 2 unresolved externals

I have it set up as a Win 32 Console Project, as someone else suggested on here, but that didn't get rid of this error.

Thanks for any suggestions.

- Brett



Answer this question

LNK2019 Error FLTK

  • DarkNoir

    Where is fl_register_images defined

    Thanks,
    Ayman Shoukry
    VC++ Team


  • Chuck521

    You're are right. fl_register_images() is declared but not defined. there are many more files to fltk than I realized. I thought including the header was all you had to do. thanks.


  • Texan VB.Nut

    It looks like you are missing the library that contains these definitions.

  • LNK2019 Error FLTK