简体   繁体   English

Xcode SDL在启动时崩溃

[英]Xcode SDL Crashes on Start

This is my first time trying to use SDL on Xcode4, but immediately, there's a problem. 这是我第一次尝试在Xcode4上使用SDL,但是立即出现了问题。 The project will compile, but when I try to run it, it immediately crashes. 该项目将编译,但是当我尝试运行它时,它立即崩溃。 I get this error message: 我收到此错误消息:

Library not loaded: @rpath/SDL.framework/Versions/A/SDL
  Referenced from: /Users/USER/Desktop/*/test.app/Contents/MacOS/test
  Reason: image not found

With the code: 使用代码:

#include <SDL/SDL.h>

int main(int argc,char** argv) 
{
    SDL_Init(SDL_INIT_EVERYTHING);
    SDL_Quit();
    return 0;
};

I followed the tutorial at this page http://meandmark.com/blog/2012/01/using-sdl-with-xcode-4/ . 我在此页面http://meandmark.com/blog/2012/01/using-sdl-with-xcode-4/中遵循了该教程。 I would really like to start developing apps for the MacOSX. 我真的很想开始为MacOSX开发应用程序。 I'm using a Lion. 我正在使用狮子。

I see a problem with your code, your call to include SDL.h. 我发现您的代码存在问题,您致电包含SDL.h。 The code should look like the following: 该代码应如下所示:

#include "SDL.h"

As the author of the tutorial you linked to, I can tell you I have an article on my site that introduces SDL and OpenGL. 作为您链接到的教程的作者,我可以告诉您我的网站上有一篇介绍SDL和OpenGL的文章。 The article includes an Xcode 4 project that can help you get started with SDL on Mac OS X. 本文包含一个Xcode 4项目,可以帮助您在Mac OS X上开始使用SDL。

SDL and OpenGL SDL和OpenGL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM