Skip to content

[ Windows ] GCC + Raylib + Clay goes wrong #535

@LUISMAGAIVER341

Description

@LUISMAGAIVER341

Ok. FIrst of all, i used to code in TS and Python .
I'm very new at c/c++ coding so i'm here to ask some help.

#define CLAY_IMPLEMENTATION
#include "clay.h"
#include "clay_renderer_raylib.c"
#include <stdio.h>

// Example error handler function for Clay_ErrorHandler
void HandleClayErrors(Clay_ErrorData errorData) {
    // See the Clay_ErrorData struct for more information
    printf("%s", errorData.errorText.chars);
    switch(errorData.errorType) {
        // etc
    }
}

int main(void){
    Clay_Raylib_Initialize(800,600 , "Clay + Raylib Test", FLAG_WINDOW_RESIZABLE);
    uint64_t clayRequiredMemory = Clay_MinMemorySize();
    Clay_Arena clayMemory = (Clay_Arena) {
        .memory = malloc(clayRequiredMemory),
        .capacity = clayRequiredMemory
    };
    Clay_Initialize(clayMemory, (Clay_Dimensions){
        .width = GetScreenWidth(),
        .height = GetScreenHeight()
    }, (Clay_ErrorHandler) { HandleClayErrors });

    Font font = GetFontDefault();

    while (!WindowShouldClose()) {
        Clay_BeginLayout();
        // * UI
        Clay_RenderCommandArray renderCommands = Clay_EndLayout();
        BeginDrawing();
        Clay_Raylib_Render(renderCommands, &font);
    }
}

This is my code
I was trying to use the intro video but it seems to be a little bit older coz it didn't work (In most part because of "too few arguments")

So basically, it compiles ok (using gcc -o raylibhelloworld.exe main3.c -I include -L lib -lraylib -lgdi32 -lwinmm) but when i run it just crash.

Image

Plus, here's my gcc -v

Image

P.S: I'm not using repo's raylib. i'm using the windows dist from raysan5/raylib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions