tzmtiancai
白马依然
采纳率33.3%
2017-03-31 02:18 阅读 1.3k

一个关于opengl的问题

具体错误说明如下:
2017-03-31 10:12:23.909523+0800 opengl[6662:327498] [General] ERROR: Setting as the first responder for window , but it is in a different window ((null))! This would eventually crash when the view is freed. The first responder will be set to nil.

程序代码如下:
#include
#include
#include
using namespace std;
int main()
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", nullptr, nullptr);
if (window == nullptr)
{
cout << "Failed to create GLFW window" << endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
}

新手刚跟着教程学opengl,所以看不懂这个错误说明到底是什么意思,希望有大佬赐教
编译器是xcode,系统是macOS Sierra 10.2.4

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • zqbnqsdsmd zqbnqsdsmd 2017-03-31 13:06

    看下你的编译器是不是不正确,这个代码需要c语言

    点赞 评论 复制链接分享

相关推荐