我首次安装了MS VS VC++,以便开始用GLFW库编程OpenGL。我跟随器上如何通过在http://shawndeprey.blogspot.com/2012/02/setting-up-glfw-in-visual-studio-2010.html 安装说明,然后我写了这个简单的程序,只是为了测试它,它做了Eclipse的工作:LINK:致命错误LNK1561:必须定义入口点在VC++中错误
#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;
}
但后来我得到了这个可怕的错误:
------ Build started: Project: first1, Configuration: Debug Win32 ------
LINK : fatal error LNK1561: entry point must be defined
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我知道,我在互联网上浏览过,我发现的唯一解决方案是“它需要main()
函数才能工作”。我显然有它,在那里,但它仍然抛出我同样的致命错误:(
将是巨大的得到关于如何解决它的反应。有可能我在安装过程中或一些瑕疵。
只是因为这个网站的,我不得不改变他们|:” 他们的:#include 及的:#include –
SortOf
如果您标记您的代码为'code',通过缩进每行四个空格与空(或点击代码突出显示的{}'按钮),英镑符号将被正确处理。 – IanPudney
这个cpp文件是你的MS项目的一部分吗?如果你右键点击它,它是否会说“Build Action | Compile”? – doctorlove