Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
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:
[code language=”cpp”]
#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();
}
[/code]
(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 Properties – Project 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:
[code language=”cpp”]
#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();
}
[/code]
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.
Title Photo by Elijah Ekdahl on Unsplash
Enter your email address below to subscribe to our newsletter
[…] to compile FLTK – [following the instruction of Principles and Practice using C++] How to compile FLTK – [following the instruction of fltk.org] This approach apparently prevents […]
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!
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.
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. 🙂
Sounds good. I will spin up a virtual machine over the weekend and try to bump into your problem, hope I can help better then. Good luck, and let me know how everything went.
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.
Thank you for your reply, I will look into this as soon as possible!
Yes, your absolutely right, I just updated the guide, thank you very much!
I got it to work now after reinstalling it, not sure what was wrong but its working! Thanks so much for your guide, really helpful! 🙂
That’s fantastic, I know it can be frustrating. But I guess your issues are solved! Thank’s for going through it and giving feedback! 🙂
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!
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…
Just updated the post, things should run from now on! Please let me know if this works for you!
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.
That’s fantastic. Really happy it helped you getting things going! I know how frustrating things can get… Thank’s for your feedback!
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!
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!
[…] How to compile FLTK – [following the instruction of fltk.org] This approach apparently prevents cross-contamination. Instead of copying files and folders from fltk-1.3.4 to the Visual Studio Community 2017 folder structure, the include and library paths are propperly (I hope so!) added to the project. How to compile FLTK – [following the instruction of Principles and Practice using C++] […]
[…] to install FLTK under Visual Stduio 2017 Community How to compile FLTK – [following the instruction of fltk.org] This approach apparently prevents […]
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.
Hi David, is the tree.cpp file in the solution explorer after you opened the fltk.sln from the source folders VisualC2010 directory? https://bumpyroadtocode.files.wordpress.com/2017/09/how-to-install-fltk-testproject-visual-studio-10.jpg?w=1100 ?
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.
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?
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.
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.
Great, good luck with everything!
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.
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.
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.
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. 🙂
Hey, thanks for following allong, would you be able to post your errors?
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
Hm wow this is really strange. I don’t think I have time immediately to look into this in detail, but will for sure in the next couple of days! Good luck anyway …
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.
I have’t seen something like that before, I’m happy your getting closer to the end of the tunnel, let me know what the problem was once you figured it out! Thanks a lot!
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!
I mean it is a massive struggel to get stuff running, but your struggle seams a bit too much. Can I just ask what OS are you using and are you on VisualStudio 2017?
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.
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.
Sounds reasonable, good luck with everything. How I said, I will put together a video soon to explain everything and how things should go with VS 2017. Thanks for trying
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.
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.
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
Thanks for your replies as well and for your clear and detailed tutorial on this page. I will look for the next one.
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 🙁
Macaretos have you seen the following entry on Stackoverflow?
https://stackoverflow.com/questions/30430789/c-hash-deprecation-warning
If you skip to the bottom there is a recommendation for downloading the newest version of std_lib_facilities.
stroustrup.com/Programming/PPP2code/std_lib_facilities.h
The main answer provides background info about stdext errors. (Which is all new to me as well)
I hope this helps.
Thank you for going the extra mile, helping out others!
You’re welcome!
It finally worked 😀 Thanks guys, you saved my life <3
Yay! 😀
Wow, that’s fantastic. What was the issue?
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.
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!!
Hi Maxim, thanks for the hint, I changed the GUI.h to GUI.cpp.
What is in your opinion incomplete/missing?
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
Currently, it is MUCH easier to install fltk (and boost and other open source libraries) on Windows (VS 2017) with vcpkg.
https://docs.microsoft.com/en-us/cpp/vcpkg
Just called “vcpkg install fltk:x86-windows” and “vcpkg install fltk:x64-windows”, and that’s it.
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.
Amazing! Good luck with everything…
Thanks a lot for your sharing! I have came across a problem when compiling the example. It says:
[code language=”css”]
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 ==========
[/code]
I followed all your steps but failed, many thanks to you if you could help!
If you have this problem
https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1169?view=vs-2017
Thanks, that helped a lot!
This was the last thing i needed to get chap 12’s drill to finally work with VS2019
I figured out the solution, thanks a lot!
Hi! What made you to correct this error?:)
Thank you very much! Your guide really helped! It worked right away!
Yay, thats fantastic, thanks for your feedback!
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?
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
Hi, have you figured this out? It should be set up for “All Configurations” – in that case, there should not be a problem.
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.
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!
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.
I got that error. I had unticked one of the inherit from project boxes. I think I did it because it was shown in one of the screen shots, but don’t !
I got that error too. I had unticked one of the inherit from project boxes. I think I did it because it is shown in one of the screen shots. If it is Don’t do it 😁
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.
This guide saved my life! You are the best, thank you!!!!
31 unresolved externals…
goto chapter17;
[…] How to install and use fltk-1.3.4 in Visual Studio 2017 2.0 [complete guide] – preventing cros… CategoriesFLTK […]
Thank you man u are the best!!!
Anybody else encounter the LNK2005 errors? void __cdelcl seedrandInt(int) already defined in Graph.obj. Demos all worked worked. Issue came up when I was just trying to the PPP p437_d_1.cpp example.
My quick remedy was just to comment out random seed generator (line 218-228) on std_lib_facilities.h. There may be a better solution, but it works.
https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1169?view=vs-2017
Add /FORCE:MULTIPLE to Linker Command Line.
What to do with Error can’t open demo.menu file??
Thank you very much for your excellent guide but I am still left with one problem. In Window.h I have compiler error C2039 ‘Vector’ : is not a member of ‘std’. It seems to point to a “disgusting macro” in std_lib_facilities but I am at a loss as to how to fix it.
Please help 🤔
https://bewuethr.github.io/installing-fltk-133-under-visual-studio/
As seen in this guide, you should comment out this Vector part:
//// trivially range-checked vector (no iterator checking):
//template struct Vector : public std::vector {
// using size_type = typename std::vector::size_type;
//
//#ifdef _MSC_VER
// // microsoft doesn’t yet support C++11 inheriting constructors
// Vector() { }
// explicit Vector(size_type n) :std::vector(n) {}
// Vector(size_type n, const T& v) :std::vector(n,v) {}
// template
// Vector(I first, I last) : std::vector(first, last) {}
// Vector(initializer_list list) : std::vector(list) {}
//#else
// using std::vector::vector; // inheriting constructor
//#endif
//
// T& operator[](unsigned int i) // rather than return at(i);
// {
// if (isize()<=i) throw Range_error(i);
// return std::vector::operator[](i);
// }
// const T& operator[](unsigned int i) const
// {
// if (isize()<=i) throw Range_error(i);
// return std::vector::operator[](i);
// }
//};
//
//// disgusting macro hack to get a range checked vector:
//#define vector Vector
Your guide helped a lot!
The last error I was having was LNK1169 (preceded by LNK2005 errors).
/FORCE:MULTIPLE solved it!
Hi man, i appreciate your work. You gift us a great guide. I have to ask you help about Stroustrup’s implementation. I correct every error that appear on screen, but there is no way to run this code. (I already correct x.H)
Compiler allerts me about incrongruences (e.g. shape) and i don’t even know where i have to start fixing that. How can i send you my code? [ i’m starting programming one years, making zapping between UE4 (for degree project) and C++ using obviously Stroustrup’s books.. so pls don’t be severe with me! ). Hope to hear from you soon!
send it over, but I cannot promise anything: p.d.siedler@gmail.com
I am so happy!!! using your guide(s) I was able to get FLTK installed correctly on a laptop running VS 2015 and another running VS 2017. I had some initial issues as documented by others: fluid failures and unable to open files. I believe what fixed my issues were to ensure both my build of FLTK and my test project were for WIN32 instead of x64
thank you so much for this. I was getting no where with the instructions in the book
Hi Philipp, great work, it helped me a lot. Everything works fine, but if i wanted to start to use the Stroustrup Files, i got these error messages:
Error 1
———
1>GUI.obj : error LNK2005: “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) is already in Graph.obj defined.
1>GUI.obj : error LNK2005: “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) is already in Graph.obj defined.
Error 2
———
1>Window.obj : error LNK2005: “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) is already in Graph.obj defined.
1>Window.obj : error LNK2005: “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) is already in Graph.obj defined.
Error 3
———
1>main.obj : error LNK2005: “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) is already in Graph.obj defined.
1>main.obj : error LNK2005: “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) is already in Graph.obj defined.
Maybe you can help me to understand what the problem is? By the way, I use Visual Studio 2019.
Hi Phil, great detailed work! Everything works fine for me with one exception at the section where we are about to include the Stroustrup files. Here I get these error messages, what do these messages mean?
Error 1
———
1>GUI.obj : error LNK2005: “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) ist bereits in Graph.obj definiert.
1>GUI.obj : error LNK2005: “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) ist bereits in Graph.obj definiert.
Error 2
———
1>Window.obj : error LNK2005: “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) ist bereits in Graph.obj definiert.
1>Window.obj : error LNK2005: “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) ist bereits in Graph.obj definiert.
Error 3
———
1>main.obj : error LNK2005: “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) ist bereits in Graph.obj definiert.
1>main.obj : error LNK2005: “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) ist bereits in Graph.obj definiert.
I’ll jump on the bandwagon here and express immense gratitude. I think I’m very close to getting FLTK to work, but when I get to the last step and try to build and run the simple “p437_d_1” code I’m getting a variety of errors. The most common are that “shapes” in an undeclared identifier (in “Window.cpp”) and many pairs of “missing type specifier” with syntax errors “missing ‘,’ before ‘&'”, which are in the Window calls with ‘const string&’ declarations (in “Window.h”)
I fucking love you man
Ohh, this is the guide that has taken me closer to finally install it, but still, not there yet…I don’t have any such file FL/Fl.h anywhere, that’s how appears named for me at least.
Now it worked for me, thank you this tutorial! 🙂
Hi, Gratitude for your great guide. I have Visual Studio 2019 everything went great until step 4, I got “Hey, I mean Hello world”. After trying to configure to configure everything after that’s what I am getting:
Severity Code Description Project File Line Suppression State
Warning C4018 ‘<': signed/unsigned mismatch Project10 C:\Users\Michael\source\repos\Project10\Window.cpp 59
Error (active) E1696 cannot open source file "C:\USERS\MICHAEL\SOURCE\REPOS\PROJECT10\WINDOW.CPP" Project10 0
Warning C4244 '=': conversion from '_Ty1' to 'int', possible loss of data Project10 C:\Users\Michael\source\repos\Project10\Graph.cpp 56
Warning C4244 '=': conversion from '_Ty1' to 'int', possible loss of data Project10 C:\Users\Michael\source\repos\Project10\Graph.cpp 57
Warning C4018 '<': signed/unsigned mismatch Project10 C:\Users\Michael\source\repos\Project10\Window.cpp 61
Error LNK2005 "class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2005 “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2005 “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2005 “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2005 “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2005 “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “protected: void __thiscall Fl_Image::draw_empty(int,int)” (?draw_empty@Fl_Image@@IAEXHH@Z) referenced in function “public: virtual void __thiscall Graph_lib::Bad_image::draw(int,int,int,int,int,int)” (?draw@Bad_image@Graph_lib@@UAEXHHHHHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Image::Fl_Image(int,int,int)” (??0Fl_Image@@QAE@HHH@Z) referenced in function “public: __thiscall Graph_lib::Bad_image::Bad_image(int,int)” (??0Bad_image@Graph_lib@@QAE@HH@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: virtual __thiscall Fl_Image::~Fl_Image(void)” (??1Fl_Image@@UAE@XZ) referenced in function “public: virtual __thiscall Graph_lib::Bad_image::~Bad_image(void)” (??1Bad_image@Graph_lib@@UAE@XZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual class Fl_Image * __thiscall Fl_Image::copy(int,int)” (?copy@Fl_Image@@UAEPAV1@HH@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::color_average(unsigned int,float)” (?color_average@Fl_Image@@UAEXIM@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::desaturate(void)” (?desaturate@Fl_Image@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::label(class Fl_Widget *)” (?label@Fl_Image@@UAEXPAVFl_Widget@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::label(struct Fl_Menu_Item *)” (?label@Fl_Image@@UAEXPAUFl_Menu_Item@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::uncache(void)” (?uncache@Fl_Image@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “void __cdecl fl_draw(char const *,int,int)” (?fl_draw@@YAXPBDHH@Z) referenced in function “public: virtual void __thiscall Graph_lib::Text::draw_lines(void)const ” (?draw_lines@Text@Graph_lib@@UBEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)” (??0Fl_JPEG_Image@@QAE@PBD@Z) referenced in function “public: __thiscall Graph_lib::Image::Image(struct Graph_lib::Point,class std::basic_string<char,struct std::char_traits,class std::allocator >,enum Graph_lib::Suffix::Encoding)” (??0Image@Graph_lib@@QAE@UPoint@1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4Encoding@Suffix@1@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_GIF_Image::Fl_GIF_Image(char const *)” (??0Fl_GIF_Image@@QAE@PBD@Z) referenced in function “public: __thiscall Graph_lib::Image::Image(struct Graph_lib::Point,class std::basic_string<char,struct std::char_traits,class std::allocator >,enum Graph_lib::Suffix::Encoding)” (??0Image@Graph_lib@@QAE@UPoint@1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4Encoding@Suffix@1@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “class Fl_Graphics_Driver * fl_graphics_driver” (?fl_graphics_driver@@3PAVFl_Graphics_Driver@@A) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Button::Fl_Button(int,int,int,int,char const *)” (??0Fl_Button@@QAE@HHHHPBD@Z) referenced in function “public: virtual void __thiscall Graph_lib::Button::attach(class Graph_lib::Window &)” (?attach@Button@Graph_lib@@UAEXAAVWindow@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: int __thiscall Fl_Input_::value(char const *)” (?value@Fl_Input_@@QAEHPBD@Z) referenced in function “public: void __thiscall Graph_lib::Out_box::put(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (?put@Out_box@Graph_lib@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Input::Fl_Input(int,int,int,int,char const *)” (??0Fl_Input@@QAE@HHHHPBD@Z) referenced in function “public: virtual void __thiscall Graph_lib::In_box::attach(class Graph_lib::Window &)” (?attach@In_box@Graph_lib@@UAEXAAVWindow@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Output::Fl_Output(int,int,int,int,char const *)” (??0Fl_Output@@QAE@HHHHPBD@Z) referenced in function “public: virtual void __thiscall Graph_lib::Out_box::attach(class Graph_lib::Window &)” (?attach@Out_box@Graph_lib@@UAEXAAVWindow@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: static int __cdecl Fl::wait(void)” (?wait@Fl@@SAHXZ) referenced in function “public: void __thiscall Simple_window::wait_for_button(void)” (?wait_for_button@Simple_window@@QAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2019 unresolved external symbol “public: static void __cdecl Fl::redraw(void)” (?redraw@Fl@@SAXXZ) referenced in function “public: void __thiscall Simple_window::wait_for_button(void)” (?wait_for_button@Simple_window@@QAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “protected: virtual void __thiscall Fl_Window::flush(void)” (?flush@Fl_Window@@MAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “protected: virtual void __thiscall Fl_Window::flush(void)” (?flush@Fl_Window@@MAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: virtual __thiscall Fl_Window::~Fl_Window(void)” (??1Fl_Window@@UAE@XZ) referenced in function “public: virtual __thiscall Graph_lib::Window::~Window(void)” (??1Window@Graph_lib@@UAE@XZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual __thiscall Fl_Window::~Fl_Window(void)” (??1Fl_Window@@UAE@XZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual int __thiscall Fl_Window::handle(int)” (?handle@Fl_Window@@UAEHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual int __thiscall Fl_Window::handle(int)” (?handle@Fl_Window@@UAEHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::resize(int,int,int,int)” (?resize@Fl_Window@@UAEXHHHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::resize(int,int,int,int)” (?resize@Fl_Window@@UAEXHHHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::show(void)” (?show@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::show(void)” (?show@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::hide(void)” (?hide@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::hide(void)” (?hide@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: static int __cdecl Fl::run(void)” (?run@Fl@@SAHXZ) referenced in function “int __cdecl Graph_lib::gui_main(void)” (?gui_main@Graph_lib@@YAHXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: void __thiscall Fl_Group::begin(void)” (?begin@Fl_Group@@QAEXXZ) referenced in function “public: void __thiscall Graph_lib::Window::attach(class Graph_lib::Widget &)” (?attach@Window@Graph_lib@@QAEXAAVWidget@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: void __thiscall Fl_Group::end(void)” (?end@Fl_Group@@QAEXXZ) referenced in function “public: void __thiscall Graph_lib::Window::attach(class Graph_lib::Widget &)” (?attach@Window@Graph_lib@@QAEXAAVWidget@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “protected: virtual void __thiscall Fl_Window::draw(void)” (?draw@Fl_Window@@MAEXXZ) referenced in function “protected: virtual void __thiscall Graph_lib::Window::draw(void)” (?draw@Window@Graph_lib@@MAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Window::Fl_Window(int,int,char const *)” (??0Fl_Window@@QAE@HHPBD@Z) referenced in function “public: __thiscall Graph_lib::Window::Window(int,int,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (??0Window@Graph_lib@@QAE@HHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Window::Fl_Window(int,int,int,int,char const *)” (??0Fl_Window@@QAE@HHHHPBD@Z) referenced in function “public: __thiscall Graph_lib::Window::Window(struct Graph_lib::Point,int,int,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (??0Window@Graph_lib@@QAE@UPoint@1@HHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK1120 31 unresolved externals Project10 C:\Users\Michael\source\repos\Project10\Debug\Project10.exe 1
Hi, thank you for your guide. Everything went great till step 4. Here are the errors that I am getting:
Severity Code Description Project File Line Suppression State
Warning C4244 ‘=’: conversion from ‘_Ty1’ to ‘int’, possible loss of data Project10 C:\Users\Michael\source\repos\Project10\Graph.cpp 57
Error (active) E1696 cannot open source file “C:\USERS\MICHAEL\SOURCE\REPOS\PROJECT10\WINDOW.CPP” Project10 0
Warning C4244 ‘=’: conversion from ‘_Ty1’ to ‘int’, possible loss of data Project10 C:\Users\Michael\source\repos\Project10\Graph.cpp 56
Warning C4018 ‘<': signed/unsigned mismatch Project10 C:\Users\Michael\source\repos\Project10\Window.cpp 59
Warning C4018 '<': signed/unsigned mismatch Project10 C:\Users\Michael\source\repos\Project10\Window.cpp 61
Error LNK2005 "class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2005 “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2005 “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2005 “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2005 “class std::mersenne_twister_engine & __cdecl get_rand(void)” (?get_rand@@YAAAV?$mersenne_twister_engine@I$0CA@$0CHA@$0BIN@$0BP@$0JJAILANP@$0L@$0PPPPPPPP@$06$0JNCMFGIA@$0P@$0OPMGAAAA@$0BC@$0GMAHIJGF@@std@@XZ) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2005 “void __cdecl seed_randint(int)” (?seed_randint@@YAXH@Z) already defined in Graph.obj Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “protected: void __thiscall Fl_Image::draw_empty(int,int)” (?draw_empty@Fl_Image@@IAEXHH@Z) referenced in function “public: virtual void __thiscall Graph_lib::Bad_image::draw(int,int,int,int,int,int)” (?draw@Bad_image@Graph_lib@@UAEXHHHHHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Image::Fl_Image(int,int,int)” (??0Fl_Image@@QAE@HHH@Z) referenced in function “public: __thiscall Graph_lib::Bad_image::Bad_image(int,int)” (??0Bad_image@Graph_lib@@QAE@HH@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: virtual __thiscall Fl_Image::~Fl_Image(void)” (??1Fl_Image@@UAE@XZ) referenced in function “public: virtual __thiscall Graph_lib::Bad_image::~Bad_image(void)” (??1Bad_image@Graph_lib@@UAE@XZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual class Fl_Image * __thiscall Fl_Image::copy(int,int)” (?copy@Fl_Image@@UAEPAV1@HH@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::color_average(unsigned int,float)” (?color_average@Fl_Image@@UAEXIM@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::desaturate(void)” (?desaturate@Fl_Image@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::label(class Fl_Widget *)” (?label@Fl_Image@@UAEXPAVFl_Widget@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::label(struct Fl_Menu_Item *)” (?label@Fl_Image@@UAEXPAUFl_Menu_Item@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Image::uncache(void)” (?uncache@Fl_Image@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “void __cdecl fl_draw(char const *,int,int)” (?fl_draw@@YAXPBDHH@Z) referenced in function “public: virtual void __thiscall Graph_lib::Text::draw_lines(void)const ” (?draw_lines@Text@Graph_lib@@UBEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)” (??0Fl_JPEG_Image@@QAE@PBD@Z) referenced in function “public: __thiscall Graph_lib::Image::Image(struct Graph_lib::Point,class std::basic_string<char,struct std::char_traits,class std::allocator >,enum Graph_lib::Suffix::Encoding)” (??0Image@Graph_lib@@QAE@UPoint@1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4Encoding@Suffix@1@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_GIF_Image::Fl_GIF_Image(char const *)” (??0Fl_GIF_Image@@QAE@PBD@Z) referenced in function “public: __thiscall Graph_lib::Image::Image(struct Graph_lib::Point,class std::basic_string<char,struct std::char_traits,class std::allocator >,enum Graph_lib::Suffix::Encoding)” (??0Image@Graph_lib@@QAE@UPoint@1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4Encoding@Suffix@1@@Z) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2001 unresolved external symbol “class Fl_Graphics_Driver * fl_graphics_driver” (?fl_graphics_driver@@3PAVFl_Graphics_Driver@@A) Project10 C:\Users\Michael\source\repos\Project10\Graph.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Button::Fl_Button(int,int,int,int,char const *)” (??0Fl_Button@@QAE@HHHHPBD@Z) referenced in function “public: virtual void __thiscall Graph_lib::Button::attach(class Graph_lib::Window &)” (?attach@Button@Graph_lib@@UAEXAAVWindow@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: int __thiscall Fl_Input_::value(char const *)” (?value@Fl_Input_@@QAEHPBD@Z) referenced in function “public: void __thiscall Graph_lib::Out_box::put(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (?put@Out_box@Graph_lib@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Input::Fl_Input(int,int,int,int,char const *)” (??0Fl_Input@@QAE@HHHHPBD@Z) referenced in function “public: virtual void __thiscall Graph_lib::In_box::attach(class Graph_lib::Window &)” (?attach@In_box@Graph_lib@@UAEXAAVWindow@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Output::Fl_Output(int,int,int,int,char const *)” (??0Fl_Output@@QAE@HHHHPBD@Z) referenced in function “public: virtual void __thiscall Graph_lib::Out_box::attach(class Graph_lib::Window &)” (?attach@Out_box@Graph_lib@@UAEXAAVWindow@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\GUI.obj 1
Error LNK2019 unresolved external symbol “public: static int __cdecl Fl::wait(void)” (?wait@Fl@@SAHXZ) referenced in function “public: void __thiscall Simple_window::wait_for_button(void)” (?wait_for_button@Simple_window@@QAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2019 unresolved external symbol “public: static void __cdecl Fl::redraw(void)” (?redraw@Fl@@SAXXZ) referenced in function “public: void __thiscall Simple_window::wait_for_button(void)” (?wait_for_button@Simple_window@@QAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “protected: virtual void __thiscall Fl_Window::flush(void)” (?flush@Fl_Window@@MAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “protected: virtual void __thiscall Fl_Window::flush(void)” (?flush@Fl_Window@@MAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: virtual __thiscall Fl_Window::~Fl_Window(void)” (??1Fl_Window@@UAE@XZ) referenced in function “public: virtual __thiscall Graph_lib::Window::~Window(void)” (??1Window@Graph_lib@@UAE@XZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual __thiscall Fl_Window::~Fl_Window(void)” (??1Fl_Window@@UAE@XZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual int __thiscall Fl_Window::handle(int)” (?handle@Fl_Window@@UAEHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual int __thiscall Fl_Window::handle(int)” (?handle@Fl_Window@@UAEHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::resize(int,int,int,int)” (?resize@Fl_Window@@UAEXHHHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::resize(int,int,int,int)” (?resize@Fl_Window@@UAEXHHHH@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::show(void)” (?show@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::show(void)” (?show@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::hide(void)” (?hide@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Source1.obj 1
Error LNK2001 unresolved external symbol “public: virtual void __thiscall Fl_Window::hide(void)” (?hide@Fl_Window@@UAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: static int __cdecl Fl::run(void)” (?run@Fl@@SAHXZ) referenced in function “int __cdecl Graph_lib::gui_main(void)” (?gui_main@Graph_lib@@YAHXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: void __thiscall Fl_Group::begin(void)” (?begin@Fl_Group@@QAEXXZ) referenced in function “public: void __thiscall Graph_lib::Window::attach(class Graph_lib::Widget &)” (?attach@Window@Graph_lib@@QAEXAAVWidget@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: void __thiscall Fl_Group::end(void)” (?end@Fl_Group@@QAEXXZ) referenced in function “public: void __thiscall Graph_lib::Window::attach(class Graph_lib::Widget &)” (?attach@Window@Graph_lib@@QAEXAAVWidget@2@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “protected: virtual void __thiscall Fl_Window::draw(void)” (?draw@Fl_Window@@MAEXXZ) referenced in function “protected: virtual void __thiscall Graph_lib::Window::draw(void)” (?draw@Window@Graph_lib@@MAEXXZ) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Window::Fl_Window(int,int,char const *)” (??0Fl_Window@@QAE@HHPBD@Z) referenced in function “public: __thiscall Graph_lib::Window::Window(int,int,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (??0Window@Graph_lib@@QAE@HHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK2019 unresolved external symbol “public: __thiscall Fl_Window::Fl_Window(int,int,int,int,char const *)” (??0Fl_Window@@QAE@HHHHPBD@Z) referenced in function “public: __thiscall Graph_lib::Window::Window(struct Graph_lib::Point,int,int,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (??0Window@Graph_lib@@QAE@UPoint@1@HHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Project10 C:\Users\Michael\source\repos\Project10\Window.obj 1
Error LNK1120 31 unresolved externals Project10 C:\Users\Michael\source\repos\Project10\Debug\Project10.exe 1
Help Please.
I am a complete newb in c++.
Hi, thank you for your guide. Everything went great till step 4. Here are the errors that I am getting:
Severity Code Description Project File Line Suppression State
Error C2084 function ‘Simple_window::Simple_window(Graph_lib::Point,int,int,const std::string &)’ already has a body Project12 C:\Users\Michael\source\repos\Project12\Simple_window.cpp 11
Error C2556 ‘bool Simple_window::wait_for_button(void)’: overloaded function differs only by return type from ‘void Simple_window::wait_for_button(void)’ Project12 C:\Users\Michael\source\repos\Project12\Simple_window.cpp 25
Error C2371 ‘Simple_window::wait_for_button’: redefinition; different basic types Project12 C:\Users\Michael\source\repos\Project12\Simple_window.cpp 21
Error C2084 function ‘void Simple_window::wait_for_button(void)’ already has a body Project12 C:\Users\Michael\source\repos\Project12\Simple_window.cpp 25
Error C2084 function ‘void Simple_window::cb_next(Graph_lib::Address,Graph_lib::Address)’ already has a body Project12 C:\Users\Michael\source\repos\Project12\Simple_window.cpp 44
Error C2084 function ‘void Simple_window::next(void)’ already has a body Project12 C:\Users\Michael\source\repos\Project12\Simple_window.cpp 51
Help Please.
I am a complete newb in c++.
It looks like each error is from Simple_window.cpp. To the best of my knowledge (having gone through Chapters 12 to 16 and completed some exercises from each), Simple_window.cpp is not needed at all–and in fact isn’t one of the files that Philipp instructs you to link in his tutorial. Try removing (excluding) Simple_window.cpp from your project and see if that helps. Good luck!
Thank your sharing, I just want to let you know you saved a newbie’s frustration during the road of C++PPP!
I just reached Chapter 12 of the book and tried following this guide exactly as shown, but I am failing at Step 4: Using fltk-1.3.4 with Bjarne Stroustrup’s header and .cpp files. This is after pasting the code snippet.
Here are the errors:
1. E0013 expected a file name BS_PPP_Cpp_fltk C:\dev\cpp_projects\BS_PPP_Cpp_fltk \p437_d_1_.cpp 1
2. E0013 expected a file name BS_PPP_Cpp_fltk C:\dev\cpp_projects\BS_PPP_Cpp_fltk\p437_d_1_.cpp 2
3. E0725 name must be a namespace name BS_PPP_Cpp_fltk C:\dev\cpp_projects\BS_PPP_Cpp_fltk\p437_d_1_.cpp 6
4. E0020 identifier “Point” is undefined BS_PPP_Cpp_fltk C:\dev\cpp_projects\BS_PPP_Cpp_fltk\p437_d_1_.cpp 8
5. E0020 identifier “Simple_window” is undefined BS_PPP_Cpp_fltk C:\dev\cpp_projects\BS_PPP_Cpp_fltk\p437_d_1_.cpp 9
6. E0020 identifier ““My” is undefined BS_PPP_Cpp_fltk C:\dev\cpp_projects\BS_PPP_Cpp_fltk\p437_d_1_.cpp 9
7. E0018 expected a ‘)’ BS_PPP_Cpp_fltk C:\dev\cpp_projects\BS_PPP_Cpp_fltk\p437_d_1_.cpp 9