-1

I'm studying Stroustrup Programming principles and practice and have a problem with using FLTK library with netbeans What I've done:

  1. downloaded library
  2. In netbeans: New project with existing sources (used path where I saved this lib), compiled it without errors.
  3. In my test project: Properties->C compiler->Include directories added path to library, the same for C++ compiler
  4. Properties->Linker->Additional Library Directories added path to .a files
  5. Libraries->Add Library added all 7 libraries from fltk/lib/*.a

Now when I try to compile my project I get a pile of errors like that:

../../../workspace/Study/fltk-1.3.4-2/lib/libfltk.a(screen_xywh.o): In function `screen_cb':

c:...\fltk-1.3.4-2\src/screen_xywh.cxx:72: undefined reference to `CreateDCA@16'

c:...\fltk-1.3.4-2\src/screen_xywh.cxx:74: undefined reference to `GetDeviceCaps@8'

c:...\fltk-1.3.4-2\src/screen_xywh.cxx:75: undefined reference to `GetDeviceCaps@8'

collect2.exe: error: ld returned 1 exit status make.exe[2]: *** [dist/Debug/MinGW-Windows/studystr.exe] Error 1

I have no idea how to fix that(((

  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – user0042 Sep 21 '17 at 15:58

1 Answers1

0

I've found solution to this problem: adding './fltk-config --compile' to Linker additional options in project's properties helped.

Also this article was usefull: http://www.fltk.org/articles.php?L598+I140+T+P1+Q