Fltk library not found in Dev-C++ despite installing

I am trying to use Dev-C++ to create a simple Fltk application.

I have installed Fltk package downloaded from https://www.fltk.org/software.php (bz2 version 1.3.5) and installed in Dev-C++ using its own package manager. It installed without any error.

Now I try to compile following simple code (from https://www.fltk.org/doc-2.0/html/example1.html):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// hello.cxx (example1)

#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/run.h>
using namespace fltk;

int main(int argc, char **argv) {
  Window *window = new Window(300, 180);
  window->begin();
  Widget *box = new Widget(20, 40, 260, 100, "Hello, World!");
  box->box(UP_BOX);
  box->labelfont(HELVETICA_BOLD_ITALIC);
  box->labelsize(36);
  box->labeltype(SHADOW_LABEL);
  window->end();
  window->show(argc, argv);
  return run();
}


The msg shown in error windows is:

1
2
3
3   25  C:\Users\RN\Documents\main.cpp  [Error] fltk/Window.h: No such file or directory
compilation terminated.
28      C:\Users\RN\Documents\Makefile.win  recipe for target 'main.o' failed


Where is the problem and how can this be solved?
Last edited on
You probably need to add the FLTK directories to your search paths in the project's settings.

Simply installing FLTK some place on your HD doesn't tell a compiler where the files are located.

Get a newer, better free IDE, Dev-C++ is years out of date. Consider getting Visual Studio 2017 or 2019, they are free for the Community edition.

The example you linked to gives instructions for using FLTK with Visual C++/Visual Studio.

Thanks for your reply.

Since Dev-C++ was installing package, I thought it would know where the files are.

Do I need to compile Fltk package before adding its directories to search paths?
I'd say "that's a big 10-4, good buddy" on compiling before using in other projects. I can't say for sure because I haven't used FLTK in quite some time. Back when I was using Dev-C++ when it was last released over four years ago.

Just me, personally, I'd consider using a newer compiler/IDE. Code::Blocks or Visual Studio, they are both free to use.

Most times when people are using FLTK is they are reading Stroustrup's C++ programming book.

IIRC he used an older version of VS.
I have installed Code::Blocks as suggested. Any good page on how to use it for library packages?
Ask for help in the C::B forums/mailing lists, there are people a lot more knowledgeable than I will ever be.
Topic archived. No new replies allowed.