craylib

raylib error : Failed to initialize Graphic Device


I m trying to install raylib c library in my linux machine , but when I compile my file with this command : cc lol.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 i get this message

 ./a.out 
INFO: Initializing raylib 4.6-dev
INFO: Supported raylib modules:
INFO:     > rcore:..... loaded (mandatory)
INFO:     > rlgl:...... loaded (mandatory)
INFO:     > rshapes:... loaded (optional)
INFO:     > rtextures:. loaded (optional)
INFO:     > rtext:..... loaded (optional)
INFO:     > rmodels:... loaded (optional)
INFO:     > raudio:.... loaded (optional)
WARNING: GLFW: Error: 65550 Description: X11: Failed to open display :0
WARNING: GLFW: Failed to initialize GLFW
FATAL: Failed to initialize Graphic Device

can you help me ?


Solution

  • WARNING: GLFW: Error: 65550 Description: X11: Failed to open display :0
    

    This error is unrelated to GL, but to the underlying XWindow system protocol. It is telling you that the X11 server to display the graphical stuff has not been reached.

    :0 display should be your local display in the machine (it's indeed the local display you will probably being running, or not). I need to know how are you running your display environment. You should be running an XWindows or wayland (with xwindows support) to be possible to connect to the X server. It can also be some authentication error, or for some reason you have initialized as a fixed string your DISPLAY environment variable (this should be the variable that holds the :0 string)