简体   繁体   English

macOS Catalina 10.15 xcode openGL 没有运行 window?

[英]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.

相关问题 Eclipse 中 C++ 调试的 macOS 10.15 Catalina gdb 问题 - macOS 10.15 Catalina gdb problem for C++ Debugging in Eclipse 为什么 Glew 在 MacOS Catalina 中找不到 OpenGL 标头? - Why is Glew not finding OpenGL headers in MacOS Catalina? macOS 10.15 Catalina 上的 Intel 编译问题:灾难性错误:无法打开源文件“stdlib.h” - Issue with Intel compilation on macOS 10.15 Catalina : catastrophic error: cannot open source file "stdlib.h" 如何继续使用 macOS Catalina 10.15.4 处理 OpenGL? - How can I continue working on OpenGL with macOS Catalina 10.15.4? C++ 在 Xcode OSX 上构建失败,出现多个错误文件 IO ... 不可用:在 macOS 10.15 中引入 - C++ Build Failed on Xcode OSX with multiple errors File IO … is unavailable: introduced in macOS 10.15 使用 Xcode 11 和 macOS Catalina (zsh) 编译后 SFML 崩溃 - SFML crashes after compiling using Xcode 11 and macOS Catalina (zsh) Gcc 在 MacOS 10.15.4 Catalina 上不起作用? - Gcc not working on MacOS 10.15.4 Catalina? macOS Catalina 屏幕录制权限 - macOS Catalina screen recording permission Xcode8.2.1上的OpenGL - 窗口中没有显示顶点 - OpenGL on Xcode8.2.1 - Vertices did not show up in the window 旧 C++ 代码中的目录查找导致 OS X Catalina 10.15 中的目录错误 - Directory lookup in old C++ code causing a directory error in OS X Catalina 10.15
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM