Closed alisherabdimuminov closed 1 month ago
I have a this code
#include <GL/gl.h> #include <GLFW/glfw3.h> #include <leif/leif.h> int main() { glfwInit(); GLFWwindow* window = glfwCreateWindow(1280, 720, "Todo", NULL, NULL); glfwMakeContextCurrent(window); while (!glfwWindowShouldClose(window)) { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.1f, 0.1f, 0.1f, 1.0f); lf_begin(); // lf_text("Salom"); lf_end(); glfwPollEvents(); glfwSwapBuffers(window); } glfwDestroyWindow(window); glfwTerminate(); return 0; }
and I compile gcc -o todo main.c -lglfw -lGL -lleif -lclipboard -lxcb -lm and run ./todo it. I came across bug like
gcc -o todo main.c -lglfw -lGL -lleif -lclipboard -lxcb -lm
./todo
[LEIF ERROR]: Failed to reallocate memory for stack datastructure. Segmentation fault (core dumped)
how to fix it?
You forgot to initialize leif after glfwMakeContextCurrent().
glfwMakeContextCurrent()
lf_init_glfw(uint32_t display_width, uint32_t display_height, void* glfw_window);
Yeah, thanks bro!
I have a this code
and I compile
gcc -o todo main.c -lglfw -lGL -lleif -lclipboard -lxcb -lm
and run./todo
it. I came across bug likehow to fix it?