Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7074

GLFW error #65544 "Failed to initialize GLFW"

$
0
0

here's my code:

#include <iostream>#include <GLFW/glfw3.h>int main(void){    GLFWwindow* window;    if(!glfwInit()){        std::cout << "Failed to initialize GLFW!" << std::endl;        return -1;    }    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);    if(!window){        glfwTerminate();        std:: cout << "Failed to initialize Window!" << std::endl;        return -1;    }    glfwMakeContextCurrent(window);    while(!glfwWindowShouldClose(window)){        glClear(GL_COLOR_BUFFER_BIT);        glfwSwapBuffers(window);        glfwPollEvents();    }    glfwTerminate();    return 0;}

I successfully linked it and compile, but I'm having a runtime errorit says that glfw failed to initialize.I tried to use glfw in C but this error shows

Wayland: Failed to connect to displayThe GLFW library is not initializedmain: ./src/posix_thread.c:64: _glfwPlatformGetTls: Assertion `tls->posix.allocated == GLFW_TRUE' failed.Aborted (core dumped)

. I'm using popOS 22.04 LTS, I'm new to c++ and glfw pls help me fix this problem


Viewing all articles
Browse latest Browse all 7074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>