白马依然 2017-03-31 03:06 采纳率: 33.3%
浏览 1968

xcode OpenGL输出一个窗口

具体错误信息:
Starting GLFW context, OpenGL 3.3
2017-03-31 11:00:23.247187+0800 opengl[6941:354760] [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.
(
0 AppKit 0x00007fff957aea3f -[NSWindow _validateFirstResponder:] + 557
1 AppKit 0x00007fff94f29b1c -[NSWindow _setFirstResponder:] + 31
2 AppKit 0x00007fff94fd1d9e -[NSWindow _realMakeFirstResponder:] + 406
3 AppKit 0x00007fff94fd1bb4 -[NSWindow makeFirstResponder:] + 123
4 libglfw.3.dylib 0x00000001000b9895 _glfwPlatformCreateWindow + 631
5 libglfw.3.dylib 0x00000001000b5430 glfwCreateWindow + 487
6 opengl 0x0000000100000fdf main + 159
7 libdyld.dylib 0x00007fffacb7d235 start + 1
8 ??? 0x0000000000000001 0x0 + 1
)
Failed to create GLFW window
Program ended with exit code: 255

代码如下
#include

// GLEW
#define GLEW_STATIC
#include

// GLFW
#include

// Window dimensions
const GLuint WIDTH = 800, HEIGHT = 600;

// The MAIN function, from here we start the application and run the game loop
int main()
{
std::cout << "Starting GLFW context, OpenGL 3.3" << std::endl;
// Init GLFW
glfwInit();
// Set all the required options for GLFW
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);

// Create a GLFWwindow object that we can use for GLFW's functions
GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "LearnOpenGL", nullptr, nullptr);
if (window == nullptr)
{
    std::cout << "Failed to create GLFW window" << std::endl;
    glfwTerminate();
    return -1;
}

}

  • 写回答

3条回答 默认 最新

  • zqbnqsdsmd 2017-03-31 13:04
    关注

    看下你的程序有没有什么编译的问题的

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog