-1

I'm trying to create a new project with FLTK and VC++2010. I haven't done this in a while. I set up the properties by memory as best I could. I'm getting a linker error though. Can anyone tell me how to fix this?

1>------ Build started: Project: BJST chap 14 ex 1a, Configuration: Debug Win32 ------ 
1>  BJST chap 14 ex 1.cpp 
1>c:\users\bryan\documents\visual studio 2010\projects\bjst chap 14 ex 1a\bjst chap 14 ex 1a\bjst chap 14 ex 1.cpp(10): error C2065: 'FL_Window' : undeclared identifier
1>c:\users\bryan\documents\visual studio 2010\projects\bjst chap 14 ex 1a\bjst chap 14 ex 1a\bjst chap 14 ex 1.cpp(10): error C2146: syntax error : missing ';' before identifier 'window'
1>c:\users\bryan\documents\visual studio 2010\projects\bjst chap 14 ex 1a\bjst chap 14 ex 1a\bjst chap 14 ex 1.cpp(10): error C3861: 'window': identifier not found
1>c:\users\bryan\documents\visual studio 2010\projects\bjst chap 14 ex 1a\bjst chap 14 ex 1a\bjst chap 14 ex 1.cpp(12): error C2065: 'FL_Box' : undeclared identifier 
1>c:\users\bryan\documents\visual studio 2010\projects\bjst chap 14 ex 1a\bjst chap 14 ex 1a\bjst chap 14 ex 1.cpp(12): error C2146: syntax error : missing ';' before identifier 'box'
1>c:\users\bryan\documents\visual studio 2010\projects\bjst chap 14 ex 1a\bjst chap 14 ex 1a\bjst chap 14 ex 1.cpp(12): error C3861: 'box': identifier not found 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 


#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>



int main ()
{

    FL_Window window(200, 200, "window title");

    FL_Box box();

return 0;
}

1 Answers1

1

This error message

error C2065: 'FL_Window' : undeclared identifier

means that the compiler did not find the declaration of identifier FL_Window. it is posiible (and I think that it is indeed so) that this name is declared in some namespace provided that you typed it correctly. Check header file <FL/Fl_Window.H> whether this name is declared in some namespace. In this case you have to write at least as

TheNameSpace::FL_Window window(200, 200, "window title");

where instead of TheNameSpace write the namespace where name FL_Window is declared.

It seems that there is also the same problem with identifier FL_Box

Vlad from Moscow
  • 301,070
  • 26
  • 186
  • 335