#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
int main()
{
using namespace fltk;
FI_Window window(200, 200, "Window title");
FI_Box box(0, 0, 200, 200, "Hey, I mean, Hello, World! ");
window.show();
return Fl:: run();
}
Above is basic FLTK program from the book Programming principles and Practices using C++ but the line using namespace fltk;
is not working giving error message name must be a namespace name. I googled and found the above code line is correct but still it shows error.
Can somebody please explain it and what to do?
I am using Visual Studio 2019 and C++ 17.
The line
using namespace fltk;
is valid only with the experimental/alpha, and dormant/discontinued, 2.0 version of FLTK. It is odd that you were told to add this line, since the rest of your code uses the naming scheme from the current, stable 1.3 version.
Remove this line from your code.