I'm trying to compile the RakNet game networking C/C++ library for use in Go. I'm currently using swig -c++ -go -cgo -intgosize 64 build.swigxx && go build
to convert the project into a Go interface, but I'm running into the following error:
build_wrap.cxx:886:56: error: variable or field '_wrap_RakNetworkFactory_set_gorak_aae8103e4a7c6905' declared void
void _wrap_RakNetworkFactory_set_gorak_aae8103e4a7c6905(RAK_DLL_EXPORT *_swig_go_0) {
^
build_wrap.cxx:886:73: error: '_swig_go_0' was not declared in this scope
void _wrap_RakNetworkFactory_set_gorak_aae8103e4a7c6905(RAK_DLL_EXPORT *_swig_go_0) {
^
build_wrap.cxx:2366:1: error: expected '}' at end of input
As far as I can tell it doesn't like the RAK_DLL_EXPORT
being defined as empty (#define RAK_DLL_EXPORT
), but I definitely don't know enough about what I'm doing to know if that's the case.
This issue seems to be specifically happening to setters being created by swig, because if I remove the header file the above is happening, swig gives me more errors of a similar nature.
The only thing vaguely approximating what I'm trying to do is this, but it looks like they're using a profoundly different version of RakNet. A lot of the resources relating to swig, cgo, and compiling C++ into go seem to be pretty dated and I haven't found any of much use.
Can anybody who understands these technologies better than I do help me figure this out?