0

I'm currently on the 12th chapter of "Programming principles and practice using c++" where you have to install fltk which I did using the VCPKG method here: Stroustrup: For C++, how do I install FLTK library?

The basic library test code

#include <FL\Fl_Box.H>
#include <FL\Fl_Window.H>
using namespace std;

int main(int argc, char *argv[])
{
    Fl_Window *window = new Fl_Window(340, 180);
    Fl_Box *box = new Fl_Box(20, 40, 300, 100, "Hello World");
    box->box(FL_UP_BOX);
    box->labelfont(FL_BOLD + FL_ITALIC);
    box->labelsize(36);
    box->labeltype(FL_SHADOW_LABEL);
    window->end();
    window->show(argc, argv);
    return Fl::run();
}

runs fine as it should, but every time I try to use the Stroustrup's headers I'm supposed to in the chapter, I get 4 unresolved external symbol "LNK" errors such as "unresolved external symbol "protected: virtual void __thiscall Graph_lib::Window::draw(void)" (?draw@Window@Graph_lib@@MAEXXZ)".

I tried putting the headers in the same directory already but it just creates other errors as if some functions are defined twice which I failed to remove. Also this is visual studio 2017 community version on Windows 10 if that helps.

  • Stourstrup's graph_lib is not part of FLTK: it just uses FLTK. Is there a graph_lib.lib somewhere? If there is, add it to the link line. – cup Mar 06 '20 at 19:49
  • @cup You mean at the project properties->linker->input->additional dependencies? Adding graph_lib.lib there did nothing. Also there is no file with that name on the PC. – billiejeans Mar 07 '20 at 17:40
  • I don't know much about Stourstrup's libraries. The FLTK section always gets questions about Stourstrup libraries and it is basically not an FLTK question. At a guess try looking for a library with the word graph in it that was installed at the same time as your headers. – cup Mar 07 '20 at 19:58

0 Answers0