Closed Vi-dot1 closed 3 months ago
This is so Confusing!!! The Readme says you only need to define RAYGUI_IMPLEMENTATION once yet half the functions are only defined under RAYGUI_IMPLEMENTATION... Aghhhh!!!!
Ok I'm not even sure why it only works this way, but by including raygui.h into the source file instead of the header fixes my issue:
/*gui.cpp*/
extern "C"{
#include"raylib.h"
#define RAYGUI_IMPLEMENTATION 1
#include"raygui.h"
}
#include"gui.h"
void drawGui()
{...}
The first time I try to build it with CMake I still get the enum mismatch warnings, but after that it compiles with no problem
I've been having problems implementing raygui 4 in my current raylib project in C++, each time I try to build it the terminal shows several lines like this for several functions inside
raygui.h
:And so on for multiple Gui functions.
I implemented raygui on its own header file kind of like this:
And a source file where I include the header and define the draw function. I tried changing
RAYGUI_IMPLEMENTATION
toRAYGUI_STATIC
but that just makes makes the functions invisible to the compilerI'm not sure if this is related, but I'm also getting a bunch of warnings about enum mismatches:
They seem to come from different places in
raygui.h
from these calls, which return values from two different enums depending on the result:That should probably go on its own issue, but I saying it here just in case is somehow related to my problem