SDL Error Undefined symbols for architecture x86_64 “_SDL_main”

后端 未结 2 1418
小鲜肉
小鲜肉 2021-02-14 07:03

I am using C++ with the SDL Cocoa and Foundation framework on my mac os x. I get the following error

Undefined symbols for architecture x86_64:
  \"_SDL_main\",         


        
2条回答
  •  盖世英雄少女心
    2021-02-14 07:36

    I had the same problem, even though my main signature was correct. I Found the answer here: SDL in XCode 4.3.2 SDLMain.o undefined symbols

    Turned out the problem was that I added SDLMain.m and SDLMain.h (according to a suggestion on the libSDL website about OS X frameworks) to an existing SDL project which messed up with main. Bottom line is that you don't need those files just because you are using Cocoa -- SDL's own test apps don't use it either and run just fine on OS X.

提交回复
热议问题