1

我知道对此有几个问题。我已经浏览了所有这些,但仍然没有找到答案。

我正在尝试在我的 Mac 上将 SDL 与 xCode 一起使用。我正在使用 xCode 4.5

我完全按照教程进行了两次!我什至尝试了第二个教程,它基本上是一样的,但它仍然没有编译。

当我编译我得到这个错误:

Ld /Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug/SDL_SetUp normal x86_64
cd "/Users/shardy/Desktop/shardy/C++ Programs/GlutApps/SDL_SetUp"
setenv MACOSX_DEPLOYMENT_TARGET 10.7
     /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/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug -F/Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug -F/Library/Frameworks -filelist /Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Intermediates/SDL_SetUp.build/Debug/SDL_SetUp.build/Objects-normal/x86_64/SDL_SetUp.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -framework SDL -framework Cocoa -o /Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug/SDL_SetUp

Undefined symbols for architecture x86_64:
"_main", referenced from:
  start in crt1.10.6.o
 (maybe you meant: _SDL_main)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

其次是:

    "_main", referenced from:
 Start in crt1.10.6.o
 (maybe you meant:_SDL_main)
 Symbol(s) not found for architecture x86_64
    Linker command failed with exit code 1 (use -v to see invocation)

我最初使用的是 xCode 4.3 并且它无法编译,所以我将 xCode 更新到 4.5 认为可能是 xCode 引起了问题并再次尝试了一切,但不幸的是,仍然没有编译......我没有足够的经验知道如何解决这个问题而且我没有相关的线程可以阅读...谢谢。

4

0 回答 0