Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MacMini M1上Xcode中的SDL-窗口未显示_Xcode_Macos_Sdl - Fatal编程技术网

MacMini M1上Xcode中的SDL-窗口未显示

MacMini M1上Xcode中的SDL-窗口未显示,xcode,macos,sdl,Xcode,Macos,Sdl,我知道这和其他一些帖子很相似,但还是有点不同。。。 我正在使用最新版本的Xcode和SDL。下面的代码应该向我显示一个窗口,但除了得到以下消息外,什么也没有发生:metalapi验证已启用 程序以退出代码结束:0 当我禁用此验证时,什么也不会发生。有什么想法可能是错误的吗 #include <SDL2/SDL.h> #include <iostream> int main() { SDL_Init((SDL_INIT_VIDEO) <0); SDL

我知道这和其他一些帖子很相似,但还是有点不同。。。 我正在使用最新版本的Xcode和SDL。下面的代码应该向我显示一个窗口,但除了得到以下消息外,什么也没有发生:metalapi验证已启用 程序以退出代码结束:0 当我禁用此验证时,什么也不会发生。有什么想法可能是错误的吗

#include <SDL2/SDL.h>
#include <iostream>

int main() {
    SDL_Init((SDL_INIT_VIDEO) <0);
    SDL_Window *window;
    window = SDL_CreateWindow("Title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_SHOWN); //also tried different WINDOW_ input here
    if (window == NULL) {
            // In the case that the window could not be made...
            printf("Could not create window: %s\n", SDL_GetError());
            return 1;
        }
    SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0);
    SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
    SDL_RenderClear(renderer);
    SDL_RenderPresent(renderer);
    SDL_Delay(3000);

}
````
#包括
#包括
int main(){

SDL_Init((SDL_Init_VIDEO)我没有足够的声誉发表评论,但首先,
int main()
应该替换为
int main(int argc,char*argv[])
我不确定
SDL_Init((SDL_Init_VIDEO)谢谢。我会试试。不确定.dll文件。我需要对此做一些研究。我想这可能与新的M1芯片有关……尝试了你的建议,但没有,什么都没有发生。