未解析的外部符号__imp_glewInit函数 main 中引用

unresolved external symbol __imp_glewInit referenced in function main

本文关键字:函数 glewInit main 引用 imp 外部 符号      更新时间:2023-10-16

所以我的链接器出错,我一直在试图解决这个问题。但是我失败了,谁能帮我这是出现的错误函数 main 中引用的未解析外部符号__imp_glewInit

格鲁32.dll 已添加


#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
using namespace std;
int main(void)
{
    GLFWwindow* window;
    if (glewInit() != GLEW_OK) {
        cout << "error" << endl;
    }
    /* Initialize the library */
    if (!glfwInit()) {
        return -1;
    }
    /* Create a windowed mode window and its OpenGL context */
    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
    if (!window)
    {
        glfwTerminate();
        return -1;
    }
    /* Make the window's context current */
    glfwMakeContextCurrent(window);
    cout << glGetString(GL_VERSION) << endl;
    /* Loop until the user closes the window */
    while (!glfwWindowShouldClose(window))
    {
        /* Render here */
        glClear(GL_COLOR_BUFFER_BIT);
        glBegin(GL_TRIANGLES);
        glVertex2f(0.1f, -0.1f);
        glVertex2f(0.5f, -0.5f);
        glVertex2f(-0.0f, -0.0f);
        glEnd();
        /* Swap front and back buffers */
        glfwSwapBuffers(window);
        /* Poll for and process events */
        glfwPollEvents();
    }
    glfwTerminate();
    return 0;
}
嘿,

我想出了问题,问题是在定义GLEW_STATIC时我忘记添加 ; 在预处理器部分