[英]macOS Catalina 10.15 xcode openGL not running window?
I am working on a c++ project with openGL on Xcode, my code is build successful.我正在使用 openGL 在 Xcode 上开发 c++ 项目,我的代码构建成功。 But there is no display window?但是没有显示window?
My Xcode settings here;我的 Xcode 设置在这里;
My first post - > Here 我的第一篇文章-> 这里
I need help, and my codes;我需要帮助和我的代码;
#include"GL/glew.h"
#include"GL/freeglut.h"
#include<iostream>
#define GLEW_STATIC
void display(void) {
}
int main(int argc, char *argv[]) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(500, 200); //glut penceresinin ekran konumu
glutInitWindowSize(500, 350); //glut penceresinin boyutları
glutCreateWindow("OpenGL Merhaba Dunya");
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
And Xcode print its terminal this error message;并且 Xcode 打印它的终端这个错误信息;
freeglut (/Users/ismailyavuz/Library/Developer/Xcode/DerivedData/ornek-acjymofglobglnbdyttjfdcvjwya/Build/Products/Debug/ornek): failed to open display ''
Program ended with exit code: 1
I research and find it.我研究并找到它。 You need the XQuartz for running windows.您需要 XQuartz 来运行 windows。
Visit this web site: https://www.xquartz.org访问此 web 站点: https://www.xquartz.org
Download and install it.下载并安装它。
It's working for me.它对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.