https://github.com/lua/lua/blob/master/lauxlib.h#L105 I guess it should be : LUALIB_API void (luaL_addgsub) (luaL_Buffer *b, const char *s, const char *p, const char *r); -- http://blog.codingnow.com