From the manual -
"The luaopen_* functions (to open libraries) cannot be called directly, like a regular C function. They must be called through Lua, like a Lua function" i.e. try lua_call() See linit.c for an example.