Ayushman Tripathi
Ayushman Tripathi

Reputation: 3

The code execution cannot proceed because glfw3.dll was not found, Reinstalling the program may fix this problem

My code was working perfectly a moment ago in Visual Studio(with vcpkg), but suddenly the next time I ran it it started giving this error. I looked for solutions online and gpt, they told me to either manually link the lib or reinstall the package. I reinstalled the package as I dont wanna link files manually(thats why i use vcpkg). But Nothing helped what else could I do.

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>

void frame_resize(GLFWwindow* window, int width, int height) {
    glViewport(0, 0, width, height);
}

void process_input(GLFWwindow* window) {
    if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) glfwSetWindowShouldClose(window, true);
}

int main() {

glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

GLFWwindow* window = glfwCreateWindow(800, 600, "thefirstone", NULL, NULL);
if (window == NULL) {
    std::cout << "windowing didnt opened" << std::endl;
    glfwTerminate();
    return -1;
}
glfwMakeContextCurrent(window);

glfwSetFramebufferSizeCallback(window, frame_resize);

if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
    std::cout << "failed to init glad" << std::endl;
    return -1;
}

// render-loop or frame
while (!glfwWindowShouldClose(window)) {
    glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);

    process_input(window);
    glfwSwapBuffers(window);
    glfwPollEvents();
}

glfwTerminate();
return 0;

}

PS C:\vcpkg> .\vcpkg.exe list
cgltf:x64-windows                                 1.14                Single-file glTF 2.0 loader and writer written i...
curl:x64-windows                                  8.11.1              A library for transferring data with URLs
curl[non-http]:x64-windows                                            Enables protocols beyond HTTP/HTTPS/HTTP2
curl[schannel]:x64-windows                                            SSL support (Secure Channel)
curl[ssl]:x64-windows                                                 Default SSL backend
curl[sspi]:x64-windows                                                SSPI support
dirent:x64-windows                                1.24                Dirent is a C/C++ programming interface that all...
drlibs:x64-windows                                2023-08-16          Single-file audio decoding libraries for C/C++
egl-registry:x64-windows                          2024-01-25          EGL API and Extension Registry
glad:x64-windows                                  0.1.36              Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader...
glad[loader]:x64-windows                                              Generate loader logic.
glew:x64-windows                                  2.2.0#4             The OpenGL Extension Wrangler Library (GLEW) is ...
glfw3:x64-windows                                 3.4#1               GLFW is a free, Open Source, multi-platform libr...
miniaudio:x64-windows                             0.11.21             Audio playback and capture library written in C,...
mmx:x64-windows                                   2022-03-27          Single header libraries for C/C++
nanosvg:x64-windows                               2023-12-29          NanoSVG is a simple stupid single-header-file SV...
nlohmann-json:x64-windows                         3.11.3#1            JSON for Modern C++
opengl-registry:x64-windows                       2024-02-10#1        OpenGL, OpenGL ES, and OpenGL ES-SC API and Exte...
opengl:x64-windows                                2022-12-04#3        Open Graphics Library (OpenGL)[3][4][5] is a cro...
qoi:x64-windows                                   2023-08-10          The Quite OK Image Format for fast, lossless ima...
raylib:x64-windows                                5.5                 A simple and easy-to-use library to enjoy videog...
raylib[use-audio]:x64-windows                                         Build raylib with audio module
restclient-cpp:x64-windows                        2024-01-09          Simple REST client for C++. It wraps libcurl for...
stb:x64-windows                                   2024-07-29#1        public domain header-only libraries
vcpkg-cmake-config:x64-windows                    2024-05-23
vcpkg-cmake:x64-windows                           2024-04-23
zlib:x64-windows                                  1.3.1               A compression library
PS C:\vcpkg>

Upvotes: -4

Views: 59

Answers (0)

Related Questions