【发布时间】:2013-07-09 21:32:27
【问题描述】:
我有一个指向动态库的函数指针,
#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 调用。
【问题讨论】:
标签: c visual-studio shared-libraries function-pointers c89