我是第一次安装MS VS VC++,以便开始使用GLFW库编写OpenGL.我在http://shawndeprey.blogspot.com/2012/02/setting-up-glfw-in-visual-studio-2010.html关注如何安装它的说明 然后我写了这个简单的程序,只是为了测试它,它确实在Eclipse上工作:
#include <stdlib.h>
#include <GL/glfw.h>
using namespace std;
int main()
{
int running = GL_TRUE;
if (!glfwInit()) {
exit(EXIT_FAILURE);
}
if (!glfwOpenWindow(300, 300, 0, 0, 0, 0, 0, 0, GLFW_WINDOW)) {
glfwTerminate();
exit(EXIT_FAILURE);
}
while (running) {
// glClear( GL_COLOR_BUFFER_BIT );
glfwSwapBuffers();
running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam(GLFW_OPENED);
}
glfwTerminate();
exit(EXIT_SUCCESS);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但后来我收到了这个可怕的错误:
------ Build started: Project: first1, Configuration: Debug Win32 ------
LINK : fatal error LNK1561: entry point must be defined
========== Build: …Run Code Online (Sandbox Code Playgroud)