小编Kyl*_*yle的帖子

extern函数原型和静态定义

我正在努力让FreeGLUT在OSX上构建,并且遇到了同样问题的许多实例.许多功能仅存在于.c文件中.

这是一个例子

extern void fghRestoreState( void );

static void fghRestoreState( void ){...}
Run Code Online (Sandbox Code Playgroud)

我对C的理解有限,但编译器错误似乎有意义:

src/Common/freeglut_gamemode.c:252: error: static declaration of ‘fghRestoreState’ follows non-static declaration
src/Common/freeglut_gamemode.c:43: error: previous declaration of ‘fghRestoreState’ was here
Run Code Online (Sandbox Code Playgroud)

我的问题是,他们是否有任何理由这样设置?它会在其他平台上正确编译吗?

c macos gcc freeglut

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

标签 统计

c ×1

freeglut ×1

gcc ×1

macos ×1