在C(C89)中获取指向动态库的函数指针

在C(C89)中获取指向动态库的函数指针,c,visual-studio,shared-libraries,function-pointers,c89,C,Visual Studio,Shared Libraries,Function Pointers,C89,我有一个指向动态库的函数指针 #include <GL/gl.h> /* or something */ void (*vertex)(float, float) = &glVertex2f; 我已经为C89配置了它;我相信这是唯一可用的C。我的想法是,在不包含库头的其他文件中,我希望将函数指针作为外部调用。Windows DLL与BSD/Linux共享库不同:( 我相信您需要GetProcAddress函数 此链接刚从Google中提取: 修复错误。这看起来很有希望,但

我有一个指向动态库的函数指针

#include <GL/gl.h> /* or something */

void (*vertex)(float, float) = &glVertex2f;

我已经为C89配置了它;我相信这是唯一可用的C。我的想法是,在不包含库头的其他文件中,我希望将函数指针作为外部调用。

Windows DLL与BSD/Linux共享库不同:(

我相信您需要
GetProcAddress
函数

此链接刚从Google中提取:


修复错误。

这看起来很有希望,但如果可以避免的话,我不包括Windows.h。
error 'vertex': address of dllimport 'glVertex2f' is not static
#include <GL/gl.h>

void (*vertex)(float, float);
int main(int argc, char **argv) {
    vertex = &glVertex2f;
    ...
}