F
F
Fedor2019-02-22 00:56:26
C++ / C#
Fedor, 2019-02-22 00:56:26

OpenGL GLEW - Procedure entry point [email protected] not found?

Good time. I do a little OpenGL. But here the standard example refused to be executed.

#include <glew.h>
#include <glfw3.h>

int main(void) {
  GLFWwindow *window;

  if (!glfwInit())
    return -1;

  window = glfwCreateWindow(640, 480, "Test", NULL, NULL);
  
  glewInit();

  if (!window) {
    glfwTerminate();
    return -1;
  }

  glfwMakeContextCurrent(window);

  while (!glfwWindowShouldClose(window)) {
    glClear(GL_COLOR_BUFFER_BIT);
    glfwSwapBuffers(window);
    glfwPollEvents();
  }

  glfwTerminate();
  return 0;
}

I use Visual Studio 2017, GLFW and GLEW libraries. All paths are specified, linkers (glfw3.lib; glew32.lib; opengl32.lib) are set.
The code compiles, but when executed, the program crashes with an error:
Message
5c6f1d249ff4c877941001.png
Conclusion
5c6f1e36930b8265413464.png

Where is the mistake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
konshyn, 2019-02-28
@konshyn

I suspect you are using glew32.lib as part of a shared library. In this case, only the exported symbols are described in this file.
As far as I remember, when building glew, there is both a dynamic library and a static one.
You have 4 options.
1. Change the path in the project to the path to the static library.
2. Throw .dll to .exe
3. Set the path to the dynamic library .dll in the PATH system variable
4. Throw .dll into any directory that is already registered in PATH.
The first two are recommended, the second two are for perverts.
The best option is the first option because:
a) glew usually does not change after assembly in projects, unless, of course, there is a config somewhere that specifies which function to import, but then loading the dynamic library itself is done by handles, not by the compiler.
b) glew weighs a little; Few programs use glew, especially on Windows.
c) Loading the program is faster, but on such a "scale" it will not be noticeable, but it is worth bearing in mind.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question