How to install and use fltk-1.3.4 in Visual Studio 2017 2.0 [complete guide] – preventing cross-contamination

Last successfully tested: 30.11.2017

Chapter 12 to 16 of Bjarne Stroustrup’s – “Programming Principles and Practice Using C++” uses a GUI library called FLTK (Fast Light Tool Kit, “full tick”). This guide demonstrates how to download, compile from source, build and use the fltk version 1.3.4 with Visual Studio 2017 Community.
This is actually the second guid I am doing for installing fltk-1.3.4. I got some feedback from fltk.org for my last guide and they suggested to rather “add the include and library paths to your project, to point at the fltk build-products in their native build directories.” to prevent cross-contamination. So this is what I did here, hope this works for you:

Step 1: Downloading fltk-1.3.4.

Go to: http://www.fltk.org/index.php
Go to the download tab and click on fltk-1.3.4-1-source.tar.gz

The fltk-1.3.4-1-source.tar.gz should be automatically downloaded.

I used winRar to extract fltk-1.3.4-1-source.tar.gz to my documents folder.

Step 2: Compiling and building fltk-1.3.4 from source.

Go to your extracted fltk-1.3.4 folder. In my case C:\Users\Philipp\Documents\dev\fltk-1.3.4-1-source\fltk-1.3.4-1\ide\VisualC2010

Open (double-click) fltk.sln.

Visual Studio 2017 Community will open, and ask you if you want to update the files.

Click OK and wait for a few moments.
Your window will look like this:

Right-click the demo solution file.
Click on Set as StartUp Project.

Now click on Build and Build Solution.

After a couple of moments your Output window shows Build: 79 succeeded…

Make sure to set Debug mode.

Press F5 on your keyboard. Or the playbutton on top of your canvas Local Windows Debugger.

So far so good. You should get two windows, one console window and another one showing the fltk-test layout.

Now change the Debug mode to Release mode on the top left corner of your Visual Studio window.

Again: Press F5 on your keyboard. Or the playbutton on top of your canvas Local Windows Debugger to run your project.
You should now see the fltk-test layout and no console window.

Done compiling and test-running. Excellent, that’s all done. Now lets setup a new project and see if Visual Studio 2017 Community is able to locate and use the files we just copied over.
Let’s open Visual Studio 2017 Community (or any other of course) and under the Visual C++ – Windows Desktop tab create a new Windows Desktop Wizard project.

Tick the box Empty project (very important).

I called it fltk_test.

In your newly created Empty Project right click the Source Files folder and Add a New Item which is going to be a .cpp file.
I called it fltk_test.cpp.

Copy the following code into your .cpp file:

#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(0, 0, 200, 200, "Hey, I mean, Hello, World!");
	window.show();
	return Fl::run();
}

(NOTE: The following Properties setup needs to be done for every new fltk project you are creating! I will tell you later to come back to this point.)
Then go to your top navigation bar and click Project and in the drop-down menu Properties.

Make sure to set the Configuration to Debug.

On your left hand side go to Linker.

And Input.

Click on the drop-down arrow in the Additional Dependencies tab.

And click on Edit.

A new window will pop up. In the screenshot shown I filled in already the following entries:

fltkd.lib
wsock32.lib
comctl32.lib
fltkjpegd.lib
fltkimagesd.lib

Please do the same.

Click OK to confirm your entry.

Now go to System.
And set the SubSystem to Console (/SUBSYSTEM:CONSOLE) with the help of the drop-down menu.

Adding include and library paths to your Visual Studio project.
Now you need to make sure Visual Studio and your fltk-1.3.4 project knows where the directory and libraries of fltk-1.3.4 are (explained in the next paragraph):

NOTE: I tested everything beforehand therefor the entries I made were already implemented, I just walked my steps back and took pictures of everything. So in your case fields for the directories might be empty or look different.

Set your Configuration setting to All Configurations again.

Choose VC++ Directories in the left hand side Menu.
Under Library Directories, click the drop down menu arrow and click <Edit…>

You should see something like this:

Now, make a new entry and fill in the native lib folder in your fltk-1.3.4 directory, in my case: C:\Users\Philipp\Documents\dev\fltk-1.3.4-1-source\fltk-1.3.4-1\lib

Accept your entry and click OK. Now under the C/C++ tab go to General.

Use the dropdown menu of Additional Include Directories and click <Edit…>

In the top field make a new entry and enter the directory of your fltk-1.3.4-1 folder, in my case: C:\Users\Philipp\Documents\dev\fltk-1.3.4-1-source\fltk-1.3.4-1

Click OK and Apply and hit F5 to test-run the project.
If you have done everything I told you so far your project should compile and run and show something like this:
(IF THIS DOES NOT SHOW UP SCROLL FURTHER DOWN!)

At this point maybe people experience an error message saying “… cannot open include file ‘x11/xlib.h’ no such file or directory …”. Here is how to fix this:
(If everything works for you just fine, please skip ahead!)

Double click the error message in your errors tab, the x.H file will open in Visual Studio 2017 Community as a new tab, if not go to your External Dependencies folder in your Solution Explorer within Visual Studio and look for the file manually and open it. As you may notice already, the errors will be underlined in curly red.

Now go to line 28, between # include “Enumerations.H” on line 27 and # ifdef WIN32 and include # define WIN32 like this:


# include “Enumerations.H”
# define WIN32
# ifdef WIN32

Safe the file and you should be good to go, now: Hit F5 to test-run the project and it should look like this:

Great, now go back to your PropertiesProject and Properties.
And chose from the Configuration Release.

On the left hand side to Linker and then to Input, just like you did before.

Click on the drop-down arrow to show the Additional Dependencies menu and select Edit.

Copy paste the following entries into the empty field (I filled them out already, Note: Since this is the Release Category there is no d for debug in the .lib names):

fltk.lib
wsock32.lib
comctl32.lib
fltkjpeg.lib
fltkimages.lib

Click OK and go to Sysyem.

Set the SubSystem to Windows (/SUBSYSTEM:WINDOWS), which can be found in the drop-down menu and click OK.

Apply your changes and exit your Properties window with OK.
Now change the Solution Configurations to Release.

And run your project by pressing F5 on your keyboard, or the playbutton on the top of your canvas Local Windows Debugger.
If everything went well you should be able to look at something like this (application window with the fltk-interface and no console window):

If you got to this point: Congratulations, you made it!
For who ever was interested in just getting the fltk-1.3.4 GUI library running and applying it on a test project, this is the end of your journey and this guide. If you are working through Bjarne Stroustrup’s Programming Principles and Practice Using C++ and you are in Chapter 12 starting to use fltk keep on reading for instructions on how to use it within the “Stroustrup”-environment:

Step 4: Using fltk-1.3.4 with Bjarne Stroustrup’s header and .cpp files.
Safe your fltk test-project and create a new project. Under the Visual C++ – Windows Desktop tab create a new Windows Desktop Wizard project, just like you did before (I will go through this a bit faster as you should be familiar by now).

Tick the box Empty project (very important).

I called mine BS_PPP_Cpp_fltk.

Right-click the Source Files folder in your Solution Explorere and Add a New Item. Create a new .cpp file, I called mine p437_d_1_.cpp.

Copy and paste the following code from Bjarne Stroustrup’s Programming Principles and Practice Using C++, Drill 1 page 437:

#include "Graph.h"
#include "Simple_window.h"

int main()
{
	using namespace Graph_lib;

	Point tl(150, 150);
	Simple_window win(tl, 600, 400, "My window");
	win.wait_for_button();
}

Go to Project and Properties and setup your project in the exact same way we did with our fltk test-project above.

Now this time, we have to add a couple of header files from Bjarne Stroustrup, and also some additional .cpp files.
Let’s begin with the header files:
Most of the people reading, working through Programming Principles and Practice Using C++ included the std_lib_facilities.h already many times so for who ever does not know where to get it from, this is the link. Download it and copy it in your project folder (in my case: C:\Users\Philipp\Documents\Visual Studio 2017\Projects\BS_PPP Cpp_fltk\BS_PPP_Cpp_fltk\BS_PPP_Cpp_fltk).
As well as the following header files:

std_lib_facilities.h
fltk.h
Graph.h
GUI.h
Point.h
Simple_window.h
Window.h

and while your on it also download and copy the following .cpp files into your project directory (as mentioned above):

Graph.cpp
GUI.cpp
Window.cpp

Right-click the Header Files folder in your project’s solution explorer. Add an Existing Item.

Once you added all your header files the Header Files folder should look like this:

Now also add the .cpp files: Graph.cpp, GUI.cpp and Window.cpp to your Source Files folder. Your Source Files folder should look like this:

Your project directory folder and your Solution Explorer in Visual Studio 2017 should look like this:

Now you are almost there. We just have to make a couple of changes to those Added files.

Open the Point.h header file by double clicking it:

Remove all the notation double forward-slashes:

Open the GUI.cpp file by double clicking it:

Add Graph_lib:: in front of Window& of Button::attach (line 8)

In_box::attach (line 30) and Out_box::attach (line 49).

and remove or notate the constructor Menu::Menu as it is already defined in GUI.cpp.

Open the Graph.cpp file:

And go to line 313. Change return ff; to return bool(ff);

The last change you have to make is in Graph.h, open and #include “std_lib_facilities.h”:

This is it. Now safe all your files and run your project. I like to just hit F5.
If everything goes right and you were able to follow my instructions you should be able to see the following:

CONGRATULATION, ALL DONE!
If you made it so far and everything worked out I am very happy I could help you. At this point I should mention Benjamin Wuethrich. I followed his tutorial on installing and using fltk on Visual Studio 2015 and with the help of a bunch of other peoples forum posts and other informations I was able to transfer the knowledge to make it happen on Visual Studio 2017 Community. So thanks to Benjamin Wuethrich. His tutorial for Visual Studio 2015 can be found here.

Thank you for going through this with me, if you have any questions I am very happy to help. Also if you have any suggestions for improvement, please let me know.

68 thoughts on “How to install and use fltk-1.3.4 in Visual Studio 2017 2.0 [complete guide] – preventing cross-contamination

  1. So I’ve tried to follow this guide and for Strousturps book. Programming Principles and Practice Using C++.
    However I just can’t get it to work. The first part works great, but step 4: where we add his files and run his program just won’t run. I get 27 errors, like: identifier “XPoint” is undefined. And “cannot open source file “X11/Xlib.h”. And some others, so I’m wondering if anyone knows how to fix this? Thanks in advance!

    Like

    1. Hi Juppo. Thanks for trying to get things to run with my guide. I am not sure though what the problem is. Are you sure you downloaded the right version of fltk? I can not even find a folder called X11 or a Xlib.h in my fltk-1.3.4-1-source folder. Did you setup your newly created project at point 4 exactly the same way as the previous project? Same properties? “Go to Project and Properties and setup your project in the exact same way we did with our fltk test-project above.” If you want e-mail me the exact list of errors so I might be able to help you out in a better way. Let me know how everything goes.

      Like

      1. I’m going to reinstall Visual Studio Community 2017 when I get back home later today, and do the guide again. I’ll let you know how it goes. 🙂

        Like

    2. I ran into the exact same problem and found the cause of it too.
      Cause:
      When creating a new project you selected “visual c++” in the left-hand menu and then proceeded with
      “Empty Project” in the right-hand window, easy mistake since all guides tell you to create an “Empty Project”.
      Solution:
      When creating a new project:
      Expend the left-hand menu of “visual c++”, select “windows desktop”, in the right-hand window select: “Windows Desktop Wizard”, this will later on give you the option to check “empty project” on a checkbox.

      Like

    1. Hi Juppo! Which VS 2017 Community workload did you install? Universal Windows Platform Development? I installed Desktop development with C++ and mine is not working with fltk 1.3.4 after following all of the tutorial. I’ve done it twice and can get all of the way through until the end when you add Stroustrup’s header and source files. I then get the same exact errors you mentioned in your first post!

      Like

      1. Hi Travis, this is the most frustrating thing on the planet. I just recently got a new machine and tried to follow the guide again and I also ran into the X11/Xlib.h problem. I will fix the guide tomorrow, but for now I can tell you what you need to do: double click the error message and the x.H file will appear, in which you can already spot the errors in red, what you want to do is “# define WIN32” between “# include “Enumerations.H”” and “# ifdef WIN32” and all problems will be solved…

        Like

  2. Hi Phil. I rarely leave comments on any page but I have no choice but to make an exception with this post. I’m grateful way beyond my ability to express it in English (I’m Spanish native). I really was about to quit and unable to get this FLTK and Simple_window thing working when I stumbled on your blog. The guide is clear, precise and more importantly, it works!
    Thanks again for your work! You made my day.

    Like

  3. Hey, I wanted to thank you for this guide. I’m learning on my own from a first edition of PPP and boy, was I confused trying to understand how to install fltk.

    As a minor note, Visual Studio has *already* done something to make this guide very slightly obsolete (although I was able to figure it out with some googling). Basically, Visual Studio 2017 15.3 removed the “create a new Win32 project” option from the menu that normally displays from File > New > Project… because they want to funnel you into their default desktop application template which doesn’t give you the option to create an empty project. To get the old menu options, you have to expand the “Visual C++” menu at the side and click Windows Desktop, which will give you the option to select “Windows Desktop Wizard.”

    For more info, ctrl+f “win32” on this page:

    https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes-v15.3

    Thanks again!

    Like

    1. Hi CS, I’m glad I could help another person on getting stuff going.. Thanks for the hint with the Win32 Project option in the menu. Those a the kind of hints which are really valuable to me, I will redo the section once I get some time, thanks a lot!

      Like

  4. I do not get as far as “Build: 79 succeeded…” when following your insructions.
    I get “Build: 68 succeeded, 11 failed, 0 up-to-date, 0 skipped”
    Most of the errors I get are similar to

    tree.cxx
    78>c1xx : fatal error C1083: Cannot open source file: ‘..\..\test\tree.cxx’: No such file or directory
    78>Done building project “tree.vcxproj” — FAILED.
    77>valuators.cxx
    77>c1xx : fatal error C1083: Cannot open source file: ‘..\..\test\valuators.cxx’: No such file or directory
    77>Done building project “valuators.vcxproj” — FAILED.

    and the files that are mentioned are indeed missing.

    and then I can’t get any further.
    I’m using fltk-1.3.4-2 (same happens with 1.3.4-1 as well) and Visual Studio community 2017 Ver 15.4.5 Microsoft Visual Studio Community 2017
    Version 15.4.5
    VisualStudio.15.Release/15.4.5+27004.2010

    Visual C++ 2017 00369-60000-00001-AA379
    Microsoft Visual C++ 2017

    I’m obviously reading PPP2 and want to start coding ASAP. Can I just ignore these errors and jump ahead or do I need to correct them first. The individual exe files do work but not from the launch application shown.
    I’m hoping you can help? Thanks.

    Like

  5. Hi,
    I’ve opened fltk.sln and tree.cxx is listed in the solution explorer. However when I double click on the file I get the message “The document cannot be opened. It has been renamed,deleted or moved”. I’ve tried a few of the files that have created executables and the .cxx just opens no problem. There appears to be 11 source files missing which is weird as I downloaded the source files just this afternoon. Is there any way I can find a list of FATAL errors produced anywhere so I can list the exact files missing (I have a list of 9 so far and I’ve a few more to find). Thanks.

    Like

    1. That is really strange. Naturally those files should be linked into the project correctly without you having to search around for files. If the fltk source folder you extracted staid the same everything should be fine. Did you set the the demo.cpp as StartUp project? as shown here https://bumpyroadtocode.files.wordpress.com/2017/09/how-to-install-fltk-testproject-setasstartupproject-visual-studio-11.jpg?w=1100? And is your configuration set to Debug and Win32?

      Like

      1. Yes, I followed your instructions exactly. I will try a different unzip program (I’m using Peazip not WinRar) on the archive to make sure all the files are being unzipped. The MD5 checksum is correct so I can’t understand what the problem is.

        Like

      2. I did a build after manually running Fluid as described above and all the demo files have built OK. I will move on for the time being (as I don’t know how fluidd.exe is invoked in the build process-the command windows pop up very quickly and then the errors start in the output window) and work through the rest of your excellent tutorial.

        Liked by 1 person

  6. I’ve discovered that it is nothing to do with the unzip programme. The 11 files in question are in the test directory but they are all .fl (fluid) files. This is why they can’t be found. I have found fluidd.exe (which got built as it’s not in the original source downloaded) and I have associated these 11 files with Fluid and then I opened each one in turn and selected “write code” for each one. This creates the .cxx and .h file for each respective .fl file. I have yet to test if this solves the problem. I also noticed there is a .cmd file and that a few command windows popped up when I followed your instructions earlier. Maybe these 11 Fluid files are not being compiled during the build process. This could be something to do with Windows 10 I don’t know.
    I will try to build the solution again over the weekend to see if what I’ve done is an effective work around.

    Like

    1. Hi David, thanks for sharing this. I’m still not quite sure what the problem is. Very soon I will produce a video on windows 10 installing fltk-1.3.4 on Visual Studio 2017 so people can see how stuff is supposed to be working by default.

      Like

  7. Hello and thank you for this tutorial. It has been immensely helpful to me! I have got to the point where I am running the demo with Stroustrup’s headers and I have only 1 error left.

    The error is the one about the menu::menu removal. When I do this, 36 additional errors are created in the obj files if I build the project.

    Do you have any idea what could cause this? I have been trying different configurations of include files.

    Like

    1. I see now that I had simply completed one set of errors and was being shown another set, which are linker errors. So I know why I have them, but I am still trying to figure out how to solve them. I will check back in case you have any ideas. 🙂

      Like

  8. They are LNK2001 and LNK2019. The fltk-only demo but the custom graph_lib header files and cpp files seem to produce the errors. I was getting them for a while when building the fltk demos and from what I’ve read they seem to have something to do with the way Visual Studio decorates file names. They start with ‘unresolved external symbol’ followed by function names and then decorated versions containing multiple @ signs and capital letters.

    In the other demos I was able to get rid of them eventually by using the absolute file paths in the include commands(not best practice but it worked for at least getting the file to run). The software seemed to need both the path to be specified and an absolute path in the include line, without one or the other the build would fail.

    With the graph_lib files the same strategy is not working, though the errors look to be of the same type.

    Here’s an example:

    LNK2001 unresolved external symbol “public: virtual void __thiscall
    Fl_Window::resize(int,int,int,int)” (?resize@Fl_Window@@UAEXHHHH@Z)
    Project6 C:\Users\Dana\source\repos\Project6\Project6\Window.obj 1

    Like

  9. I’ve got down to one linker error:

    Error LNK2019 unresolved external symbol “__declspec(dllimport)
    int __cdecl _wopen(wchar_t const *,int,int)” (__imp_?_wopen@@YAHPB_WHH@Z)
    referenced in function _fl_open

    It seems to be something to do with dll imports and fl_utf8.h. Don’t feel you have to dig into it too much as it seems fairly obscure.

    I’ll try to make a post tomorrow about what I did to fix the rest of the errors, as I tried a number of things that made incremental reductions in the errors.

    Like

  10. Here are the additional things I have done that have fixed errors.

    During compiler errors:

    Changed several sets of () to {} for point objects and other initializer lists.

    Using full file paths for include files.

    During linker errors:

    Double-checked lib dependencies for debug and release.

    Added ‘legacy_stdio_definitions.lib’ to linker input. For errors relating to printf and scanf.

    For an error relaing to iob_func, added the following function to the main cpp file.
    extern “C” { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }

    Somebody else defined _NO_CRT_STDIO_INLINE before stdio was loaded and had some errors disappear but it didn’t work for me. Also there was a warning that msvcrt library conflicted with others but many errors were produced if I excluded it.

    I’ll keep you posted on the other error!

    Like

  11. It really does, doesn’t it? I finally got the build to succeed. I’ll write up what I did in the next comment.
    I’m using Visual Studio 2017 Community, which I just downloaded in the last week. Windows 10, pretty normal system. I was about ready to give up but it seems trying ‘just one more thing’ can be what is needed.

    Like

  12. I got the demo to compile OK and I’m now using Notepad ++ and MinGW (G++) for the chapters up to chapter 12. I’ve been put off using Visual Studio until I MUST to use it. It’s just too complicated for a beginner like me and I want to spend more time learning the language NOT the IDE.It would be nice if I could get the FLTK stuff to compile with G++ and Notepad++ and I’m going to try this at some stage.

    Like

  13. I don’t know if this is a good solution or not, but here is what worked.
    I moved the definition of the wopen function from a Windows SDK kit file called corecrt_wio.h
    to my main cpp file. (I may move it to a header file to stream-line)
    corecrt_wio.h contains _wopen, which was being accessed through fl_utf8.h and fl_utf8.obj
    I’m not enough of an expert to know if this move has any other consequences but it
    did allow the build to succeed. I did have to run corecrt_wio.h as an admin.

    I hope this might help someone running across similar issues.

    Like

    1. I should add that this was specifically to solve the LNK2019 linker error with wopen and shouldn’t be done otherwise. Ideally no one else will encounter the same error.

      Like

      1. Well, thank you very much for posting your solution. Honestly I’m not enough of an expert either… Hope all is well for now and you can get up and running with the actual coding. I will produce a video tutorial for VS 2017 on win 10, so check back some time if you’d like. Thanks

        Like

  14. So, you told me to use this guide, cause in the other one I had a lot of problems. Well, this one didn’t changed anything, as I still got same error as earlier:
    #error is deprecated and will be REMOVED. Please use . You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
    I searched for solution, but nobody had same error 😦

    Like

  15. Hey guys,
    I’ve been trying to uninstall and reinstall visual studio multiple times and I seem to be having the same issue as Dana had. There seems to be several linker errors (Code: LNK2019, LNK2001 and LNK2005). Most of them seem to relate to unresolved externals somewhere in Graph_lib, but I can’t put my finger on where or what to do with them. Been a week since I’ve been struggling with this issue and I thought I should maybe ask for the help of experts.

    Like

  16. everything is good until this moment

    Function sine{ sin,0,100,Point{ 20,150 },1000,50,50 }; // bad
    win.set_label(“Canvas #4”);
    win.wait_for_button();

    Function not displayed

    and
    Polygon\Rectangle\Ellipse
    require Graph_lib:: to work correctly because they are not single-valued

    and in GUI.h there is no menu::menu,this is in GUI.cpp

    Despite the fact that your guide is incomplete, anyway thank you very much!!

    Like

      1. I am very sorry, im so stupid! I forgot to display the function in the window! 14.11.25503 and 14.12.25827 I put the files in both of these folders, but maybe there was enough one folder I’m not sure

        Like

  17. Thank you. I was considering skipping chapters 12-16 of Stroustrup’s book after trying for ages to set it up. But your guide worked for me on the first try and I am now a very happy person.

    Like

  18. Thanks a lot for your sharing! I have came across a problem when compiling the example. It says:

    1>------ Build started: Project: fltk_test, Configuration: Debug Win32 ------
    1>Source.cpp
    1>fltkd.lib(Fl_Box.obj) : error LNK2005: "public: __thiscall Fl_Box::Fl_Box(int,int,int,int,char const *)" (??0Fl_Box@@QAE@HHHHPBD@Z) already defined in Source.obj
    1>D:\C++Projects\fltk_test\Debug\fltk_test.exe : fatal error LNK1169: one or more multiply defined symbols found
    1>Done building project "fltk_test.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    

    I followed all your steps but failed, many thanks to you if you could help!

    Like

  19. Thank you very much for this very thorough guide. Unfortunately it didn’t quite work for me and I was wondering if you could answer some questions.

    I got the debug version in part 3 to work, but when I built and ran the release version, I got 9 errors.

    All of them said something like: cannot open source file “FL/Fl_Window.h”

    It looked like I had mistyped the location of the folder, but in the guide you didn’t mention anything about, I went through the process again, but couldn’t find any deviations from the guide, so I decided to add the addresses to “library directories” and “additional include directories” to the release version’s properties, which seems to have solved the problem. At least it now exits with code 0.
    My problem is that since working with libraries this way, is still very new to me So, I can’t help worrying that I’ve made a mistake by improvising this way.
    Am I simple missing something?
    I’ve noticed that in both cases the output window shows a lot of “Cannot find or open the PDB file.” messages, is this normal?

    Like

    1. I ran into a second problem in the fourth step. Like before, I added the added the paths to “library directories” and “additional include directories” in the release version’s properties. But the program still refused to compile and gave a series of error messages:
      Severity Code Description Project File Line Suppression State
      Warning C4018 ‘<': signed/unsigned mismatch C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\window.cpp 59
      Warning C4244 '=': conversion from 'double' to 'int', possible loss of data C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 56
      Warning C4244 '=': conversion from 'double' to 'int', possible loss of data C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 57
      Error C2440 'initializing': cannot convert from 'initializer list' to 'Graph_lib::Point' C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 74
      Error C2440 '’: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 148
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 169
      Error C2664 ‘Graph_lib::Text::Text(const Graph_lib::Text &)’: cannot convert argument 1 from ‘std::string’ to ‘const Graph_lib::Text &’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 169
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 175
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 180
      Error C2660 ‘Graph_lib::Lines::add’: function does not take 1 arguments C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 180
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 190
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 195
      Error C2660 ‘Graph_lib::Lines::add’: function does not take 1 arguments C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph.cpp 195
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\simple_window.h 13
      Error C2661 ‘Graph_lib::Button::Button’: no overloaded function takes 4 arguments C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\simple_window.h 13
      Error C2440 ‘initializing’: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\graph_drill.cpp 15
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\gui.cpp 67
      Error C2440 ”: cannot convert from ‘initializer list’ to ‘Graph_lib::Point’ C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\gui.cpp 71
      Warning C4018 ‘<': signed/unsigned mismatch C12 – Graphic Drill c:\users\simon\source\repos\c12 – graphic drill\c12 – graphic drill\window.cpp 61

      After getting a bit of help, I managed to get it to run by adding a constructor to the Point header.
      It now looks like this:

      #ifndef POINT_GUARD
      #define POINT_GUARD

      namespace Graph_lib {

      struct Point {
      int x,y;
      Point(int x, int y) : x(x), y(y) {}

      };

      inline bool operator==(Point a, Point b) { return a.x==b.x && a.y==b.y; }

      inline bool operator!=(Point a, Point b) { return !(a==b); }

      }
      #endif

      Like

  20. please make video for last part in which you including “std_lib_facilties.h”, “window.h”,”graph.h”
    i have tried so many time and every time i am getting error. so please make video for it.
    As early as possible.

    Like

  21. Hi bumpyroadtocode, thanks so much for this. It’s after coming across your instructions that I managed to get FLTK working. Considering that my last unsuccesful attempt was in January, 2017! Many thanks again!

    Like

  22. I wanted to post this in the off chance you’d be able to assist. I tried your tutorial for installing FLTK and when I hit F5 after adding all the dependencies, etc., I get the error “cannot open file ‘wsock32.lib'”. I haven’t seen anyone else have this error so I was curious if you may have any insight. Thanks for the great, easy-to-follow tutorial! The best I’ve found.

    Like

  23. I just couldn’t pass by without leaving a word of gratitude. I was so troubled with installing fltk and without this, I don’t think I could have progressed. Thanks a million.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.