我有一个指向动态库的函数指针,
#include <GL/gl.h> /* or something */
void (*vertex)(float, float) = &glVertex2f;
在 GCCi686-apple-darwin10-gcc-4.2.1 上它一直有效,但在 Visual Studio 2010 上失败了,
error 'vertex': address of dllimport 'glVertex2f' is not static
我已经为 C89 配置了它;我相信这是唯一可用的 C。这个想法是我想extern
在不包含库头的其他文件中调用函数指针。