I’m writting a C++ wrapper.
Imagine the following project:
src.cpp
#include "src.h"
struct SourceType {
int foo;
};
src.h
:
struct SourceType;
c.h
is a C wrapper of this C++ code:
typedef struct SourceType SourceType;
struct SourceType;
wrapper.h
is a wrapper for GO:
#pragma once
#include "c.h"
main.go
:
package main
/*
#include "wrapper.h"
*/
import "C"
func main() {
var foo C.SourceType
_ = foo
}
I’m getting the following error:
# example.com
./main.go:9:6: _Ctype_struct_SourceType is incomplete (or unallocatable); stack allocation disallowed