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

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 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥30 用arduino开发esp32控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题