Skip to content

compile raygui

o3o edited this page Sep 10, 2020 · 2 revisions

In order to compile raylib with raygui support follow compile raylib and then:

  1. Clone raygui:
$ cd ~/cc
$ git clone https://github.com/raysan5/raygui.git
  1. Copy raygui/src/*.h to raylib/src
$ cd raygui
$ cp src/*.h ../raylib/src
  1. Modify raylib/src/Makefile in order to add icons support:
@@ -575,6 +575,7 @@ raygui.o : raygui.c raygui.h gui_textbox_extended.h ricons.h
        $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -DRAYGUI_IMPLEMENTATION
 raygui.c:
        echo '#define RAYGUI_IMPLEMENTATION' > raygui.c
+       echo '#define RAYGUI_SUPPORT_ICONS' >> raygui.c
        echo '#include "$(RAYLIB_MODULE_RAYGUI_PATH)/raygui.h"' >> raygui.c

Or use tools/Makefile_with_raygui_support:

$ cd ~/cc/raylib
$ cp ~/d/bindbc-raylib/tools/Makefile_with_raygui_support src/Makefile
  1. Compile with raygui support (RAYLIB_MODULE_RAYGUI=TRUE)
$ make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE
$ sudo make install PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_MODULE_RAYGUI=TRUE

make install installs libraries into /usr/local/lib. In order to install into different path use DESTDIR:

$ sudo make install RAYLIB_LIBTYPE=SHARED DESTDIR=/usr
Clone this wiki locally