简体   繁体   中英

X11/Xlib.h: No such file or directory Windows 10

I'm working on a school project using FLTK lib to build some graphs with c++:

Here is the source of the basic tuto:

https://github.com/cortical-iv/hello_fltk

when building this code with the command make, I'm getting this error:

X11/Xlib.h: No such file or directory

I searched about this and found that generally X11 lib are used on Linux systems!

So please, any idea how can I make this work on windows !

Try adding to Makefile line 2 fltk-config --cflags :

CFLAG = -std=c++14 `fltk-config --cflags`

You are probably compiling for 64-bit Windows. FLTK requires that WIN32 be defined even if it is compiled on 64-bit Windows. If WIN32 is not defined, then the FLTK headers will include files used on LINUX operating systems instead of Windows.

FTR: it is correct that FLTK 1.3.x (and the older 1.1.x) requires the compiler macro WIN32 to be set by the build system, ie the command line or in Visual Studio in the compiler setup. This is (was) a non-standard approach and has been changed in FLTK 1.4.

In FLTK 1.4 (not yet released) we use the standard _WIN32 macro (with leading underscore) which is usually defined in all known compiler environments on Windows [1]. This is true for 32-bit as well as 64-bit compilations.

[1] except if you build using the Cygwin target with the Cygwin dll (POSIX compatibility layer). (If you don't know what that is, don't care.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM