我正在尝试使用 XCode 4.4 运行 SDL,但遇到了问题。我完全按照该站点http://www.lazyfoo.net/SDL_tutorials/lesson01/mac/xcode/index.php的指示进行操作,但它没有编译并给我以下错误。
ld /Users/Jeffrey/Library/Developer/Xcode/DerivedData/SDL_test1-gymiyuicyswxljbpwkggciejevaj/Build/Products/Debug/SDL_test1 normal x86_64 cd /Users/Jeffrey/Documents/Documents/Engineering/SDL_test1 setenv MACOSX_DEPLOYMENT_TARGET 10.8 /Applications/Xcode.app/ Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users /Jeffrey/Library/Developer/Xcode/DerivedData/SDL_test1-gymiyuicyswxljbpwkggciejevaj/Build/Products/Debug-F/Users/Jeffrey/Library/Developer/Xcode/DerivedData/SDL_test1-gymiyuicyswxljbpwkggciejevaj/Build/Products/Debug-F/Library/Frameworks -filelist /Users/Jeffrey/Library/Developer/Xcode/DerivedData/SDL_test1-gymiyuicyswxljbpwkggciejevaj/Build/Intermediates/SDL_test1。build/Debug/SDL_test1.build/Objects-normal/x86_64/SDL_test1.LinkFileList -mmacosx-version-min=10.8 -framework SDL -framework Cocoa -o /Users/Jeffrey/Library/Developer/Xcode/DerivedData/SDL_test1-gymiyuicyswxljbpwkggciejevaj/构建/产品/调试/SDL_test1
架构 x86_64 的未定义符号:“_main”,引用自:-u 命令行选项(也许您的意思是:_SDL_main) ld:未找到架构 x86_64 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 - v 查看调用)
唯一的差异在于第 9 步(进入您添加的 SDLmain.m 模板文件并将 #include "SDL.h" 更改为 #include "SDL/SDL.h")我实际上并没有找到包含语句,而是一个进口声明。然而,我尝试了两种方式。任何帮助,将不胜感激。我正在使用带有 Mountain Lion 操作系统的 Macbook Pro。