相关疑难解决方法(0)

简单地包括SDL标头会导致链接器错误

我打算将我的游戏从过剩迁移到sdl.

它完全适应过剩,但我想使用一些sdl功能.

所以我进入我的项目属性,在目标标题下我单击要编译的程序,构建阶段,链接二进制文件库,添加SDL.framework

与我为OpenGL.framework和GLUT.framework完成的操作完全相同

但是,当我添加:#include <SDL/SDL.h>当我尝试构建时,它会出现链接器错误:

Undefined symbols for architecture x86_64:
  "_main", referenced from:
      __start in crt1.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)
Run Code Online (Sandbox Code Playgroud)

谷歌搜索只会导致一些公平的结果,但没有真正的解释.

c++ opengl macos sdl xcode4

11
推荐指数
1
解决办法
7717
查看次数

标签 统计

c++ ×1

macos ×1

opengl ×1

sdl ×1

xcode4 ×1