Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAYGUI : Undefined Reference and Double Defined Errors #4345

Closed
Universal-Flare opened this issue Sep 28, 2024 · 4 comments
Closed

RAYGUI : Undefined Reference and Double Defined Errors #4345

Universal-Flare opened this issue Sep 28, 2024 · 4 comments

Comments

@Universal-Flare
Copy link

Please, before submitting a new issue verify and check:

  • [yes] I tested it on latest raylib version from master branch
  • [yes] I checked there is no similar issue already reported
  • [yes] I checked the documentation on the wiki
  • [yes] My code has no errors or misuse of raylib

Issue description

It shows the error of Double Definitions which are defined in both raylib and raygui.
Without #define RAYGUI_IMPLEMENTATION at the top of the code, it shows an undefined reference error when run.

Environment

OS: Windows 11
OpenGL: Same from Raylib Default
Build System: Meson

Code Example

#include "raylib.h"

#define RAYGUI_IMPLEMENTATION
#include "raygui.h"

int main() {

    int screenWidth = 800;
    int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "");
    SetTargetFPS(60);

    bool BOXActive = true;

    Rectangle layoutRecs[1] = {
        (Rectangle){ 352, 64, 512, 408 },
    };

    while (!WindowShouldClose()) {

            ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));

            if (BOXActive) {
                BOXActive = !GuiWindowBox(layoutRecs[0], "BOX_NAME");
            }

        EndDrawing();
    }

    CloseWindow();
};
@Universal-Flare
Copy link
Author

Raylib Works perfectly fine with meson as I am using the CMake Module

@Universal-Flare
Copy link
Author

sorry, accidentally clicked the wrong button

@Universal-Flare
Copy link
Author

As i was saying, the raygui.h file for that code in my project does not work and give those errors.
I thought it was because of the first inititalisation of the functions but i was wrong

@raysan5
Copy link
Owner

raysan5 commented Sep 29, 2024

@Universal-Flare I'm afraid I can't reproduce, it could be related to the build system used.

@raysan5 raysan5 closed this as completed Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants