#include "lua.h"

extern "C"
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
__declspec(dllimport)
#endif
int luaopen_luapbintf(lua_State* L);

int main() {
    int (*pFun)(lua_State*);
    pFun = luaopen_luapbintf;
    return 0;
}

#include "lua.h"

extern "C"
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
__declspec(dllimport)
#endif
int luaopen_luapbintf(lua_State* L);

int main() {
    void * p = static_cast<void*>(luaopen_luapbintf);
    return 0;
}

--- 
+++ 
@@ -7,6 +7,7 @@
 int luaopen_luapbintf(lua_State* L);
 
 int main() {
-    void * p = static_cast<void*>(luaopen_luapbintf);
+    int (*pFun)(lua_State*);
+    pFun = luaopen_luapbintf;
     return 0;
 }
Fix error: invalid static_cast from type ‘int(lua_State*)’ to type ‘void*’
