raysan5 / raygui

A simple and easy-to-use immediate-mode gui library
zlib License
3.36k stars 289 forks source link

Undefined reference to GuiLoadStyle #353

Closed rhodso closed 9 months ago

rhodso commented 9 months ago

I've got raygui and raylib, and I've linked them to my current project. I've got a basic program that just creates a window, and that shows up perfectly fine:

image

However, when I add the line GuiLoadStyle("data/style_cyber.rgs");, I get an error from the linker:

image

Given that without this line it works completely fine, I'm fairly confident I'm not the one being dumb here, but that is also entirely possible, many thanks in advance for any help!

raysan5 commented 9 months ago

How are you including "raygui.h"? Did you check the examples?

It seems you are not defining #define RAYGUI_IMPLEMENTATION

rhodso commented 9 months ago

Thanks very much, that's now working

I added:

#include "raylib.h"
#define RAYGUI_IMPLEMENTATION

to the header file and then modified the makefile's run target to:

run: playground
    export LD_LIBRARY_PATH=./lib/raylib/lib && ./playground

It's not appearing to do much at the moment, but I'm assuming that's because I'm doing something dumb and not understanding how styles work.
image

Thanks very much again!