【发布时间】:2015-10-20 12:30:05
【问题描述】:
export go func 到 c 时,接口类型 port 到 GoInterface,int 到 GoInt。如何移植我的 c 函数以使用这些类型?
啊。
void *SomeFunc(GoInterface arg);
交流
void *SomeFunc(GoInterface arg) {
}
去吧
package main
// #include "a.h"
import "C"
type A struct {
}
func main() {
var a = new(A)
}
当我开始构建时:
cc errors for preamble:
In file included from ./a.go:3:0:
a.h:1:16: error: unknown type name 'GoInterface'
void *SomeFunc(GoInterface arg)
有没有像 java 的 jni.h 这样的 go 头文件,所以我可以包含类型。
【问题讨论】: