Error C1083: Cannot open include file: 'FL / Fl.h': no ​​such file or directory

First of all, I am still a beginner and therefore do not know how to format the code, so it looks neat in this question, I hope this is acceptable. I follow the principles and practice of programming from Stroustrup. You can guess what the problem is ... yes FLTK instalation. I carefully followed all the steps to build a project on VS C ++ 2013; pages 1204-1206. (I have successfully applied C application related to std_lib_facilities.h).

I tried to create the following win32 project, as shown in the book:

#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(); } 

After creating the solution, I get the error message: Error 1 error C1083: Cannot open the include file: "FL / Fl.h": there is no such file or directory

I also followed the steps to copy through some lib files from the FLTK lib directory to the course files c: \ users \ pablo \ desktop \ C ++ \ visual C ++ \ win32project1 \ source.cpp, which is the file that I created for Visual Studio Express 2013. Can someone help me? Where can I find this missing file? Perhaps the problem is that the FLTK version is a bit outdated for use in VS 2013? (When I compiled the FLTK library, I had some errors related to the backup file and some warnings.) I studied this for a long time. I found some questions related to this in this forum, but not quite related to the above problem. Thank you very much in advance.

PS Well, there was one question related to the same error. I followed some of the tricks mentioned as an answer to the same question, but to no avail.

("The best trick you can do for these types of errors is to place the cursor in the file name of the #include statement and press Ctrl + Shift + G. It will fail and display a message box indicating that it includes paths. Simply adding additional paths inclusion in the SDK, right-clicking on your project and go to "Properties"> "C / C ++"> "General" and "Additional inclusion directories."

Another suggestion shown does not work: ("Make sure the include directory is not the FL directory, but its parent. The reason for this is because you say #include" FL / Fl.h ", asking the compiler to go into the FL folder to find Fl .h, which will be in the FL parent. If you specify FL as the include directory, you only need to say #include "Fl.h" ").

+5
source share
2 answers

This is because there is no header file named #include <FL/Fl.h> , which it implies by this: include either #include <FL> or #include <FL.h> depending on which program you are creating but the first, most likely, you want to do since then is the standard version. #include <FL.h> is an old library and is not even part of the standard. It is also not included in every platform. You should not use the .h version in this example.

The same can be said for the other two header files.

+2
source

The other answer is not remotely (I literally just compiled the FLTK program with all the headers in the form #include <FL/xxx.H> ). When you download FLTK, you get a directory (say fltk-1.3.2) that has this structure

 /fltk-1.3.2/ FL/ GL/ src/ lib/ examples/ + other stuff 

The FL subdirectory contains all the header files. Thus, if you placed the fltk-1.3.2 directory, it is located in \ foo \, then you need to add \ foo \ fltk-1.3.2 \ to your additional header field. Be careful, maybe you accidentally selected the wrong directory (this happens), or you could extract the contents of the zipped version of the file into a sub-version, which means that you might have something like \ foo \ fltk-1.3.2 \ fltk-1.3.2 \ So look.

If it cannot find the headers, you almost certainly have additional include fields that appear in the wrong place or in the wrong format. Click on the drop-down list button, click the "Edit" button and manually click on the new folder button and navigate to it.

What you will find next is that you must point the linker in the right direction. In the above example, the default location for installing library files (.lib static should be the default for FLTK), so you need to add \ foo \ fltk-1.3.2 \ lib \ to the configuration properties β†’ Linker β†’ General β†’ Additional library directories

Then you need to connect the specific libraries. Since the linker now knows where to look for you, you need to specify a path, but just name them. To do this, go to configuration properties β†’ Linker β†’ Input β†’ Additional dependencies, click the drop-down list, click on the edit and add fltkd.lib, fltkformsd.lib, fltkzlib.lib, wsock32.lib on separate lines (without these commas)

+1
source

Source: https://habr.com/ru/post/1205571/


All Articles