mercredi 11 mars 2020

std::bind not interoperable with lua_call

Using the developement libraries for Lua 5.3.5 and gcc 9.2.0 I have encountered a weird compilation issue for the following minimal snippet:

#include <functional>

extern "C" {
  #include "lua.h"
  #include "lualib.h"
}

int main()
{
  using namespace std::placeholders;

  auto lua_simple_call = std::bind(lua_call, _1, 0, 0);
}

gcc complains: error: ‘lua_call’ was not declared in this scope. This issue does not occur when trying to simply call lua_call without the use of std::bind and it also does not seem to occur for other Lua C functions like lua_newtable etc. I would like to know what's causing this and how to circumvent it.

Aucun commentaire:

Enregistrer un commentaire