I have a library that I want to use which only provides C++ header files and a static library. Go is unable to parse the namespaces that it is wrapped in.
I have looked at this: How to use C++ in Go? and it makes sense, but there are no namespaces involved there.
This is the C++ code in question that when imported causes issues (only the beginning shown):
#pragma once
#include <stdint.h>
namespace ctre {
namespace phoenix {
And here is the result of compiling:
./include/ctre/phoenix/ErrorCode.h:4:1: error: unknown type name 'namespace'
namespace ctre {
^~~~~~~~~
./include/ctre/phoenix/ErrorCode.h:4:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
namespace ctre {
Is there any way that I can provide a C wrapper which avoids this problem?