On 12.02.2017 06:22 DS wrote:
> Ok, just did that, and, it seems to have gotten further, but has
> different errors. I only made changes under C++/Preprocessor, not under
> Linker. Wasn't sure you were telling me to do that.
No, I didn't tell you that, but didn't we discuss that recently? I just
told you how to do it (by using the edit menu). See below.
> These are the errors now:
> Severity Code Description Project File Line Suppression State
> Error LNK2019 unresolved external symbol "public: static int __cdecl
> Fl::run(void)" (?run@Fl@@SAHXZ) referenced in function
> _main Project2 c:\Users\DSNoS\OneDrive\documents\visual studio
> 2015\Projects\Project2\Project2\Source.obj 1
This tells you that the linker could not find the FLTK lib (Fl::run()),
the other errors were similar (about Fl_File_Chooser).
What you need is documented in the chapter "FLTK Basics":
http://www.fltk.org/doc-1.3/basics.html#basics_visual_cpp
"In Visual C++ you will need to tell the compiler where to find the FLTK
header files. This can be done by selecting "Settings" from the
"Project" menu and then changing the "Preprocessor" settings under the
"C/C++" tab. You will also need to add the FLTK (FLTK.LIB or FLTKD.LIB)
and the Windows Common Controls (COMCTL32.LIB) libraries to the "Link"
settings. You must also define WIN32.
More information can be found in README.MSWindows.txt."
Please take a look at README.MSWindows.txt, chapter "Creating new Projects":
Create a new project of type "General", "Empty Project" and add a simple
"C++" file to it. The FLTK "hello" source code is a good base.
Now open the Project Properties dialog and add "Comctl32.lib" and all
the FLTK libraries that you want to use (at least "fltk.lib") to
Additional Dependencies (Configuration Properties > Linker > Additional
Dependencies). In the same dialog, add "WIN32" to the C++ Preprocessor
Definitions (Configuration Properties > C/C++ > Preprocessor >
Preprocessor Definitions).
Note: there are more instructions worth to take a look at. The
instructions above don't show the hint I gave you before to click once
on the option field and use the '<Edit...>' menu, but that was likely
not available in this form in the older VC++ version the docs are based on.
So, to sum it up: you added the WIN32 define, but you still need to add
the FLTK lib (fltk.lib or fltkd.lib) and comctl32.lib to the linker
settings. You may need to use the full path for fltk.lib or add, as
Nikita wrote:
Linker=>General=>Additional Library Directories :
C:\FLTK\fltk-1.3.4-1-source\fltk-1.3.4-1\lib
That would add the path so you can just use 'fltk.lib'.