首页 > 解决方案 > 无法为共享对象编译插件

问题描述

看起来我的问题是 GoLang 在插件中包含运行时,因此它们无法共享。我做了

go install -buildmode=shared std

然后我尝试将我的插件编译为共享:

 go build -buildmode=plugin -linkshared /tmp/code_SUM.go
# command-line-arguments
runtime.islibrary: missing Go type information for global symbol: size 1

我的代码

# cat /tmp/code_SUM.go
package main
import (
        "fmt"
)
func SUM(x int, y int) int { fmt.Println("")
return x+y}

是否有任何解决方法或某种方法来修补/更改 Go 编译器/语言以使我的程序发生?

标签: gopluginscompiler-errorsshared-librariesstatic-libraries

解决方案


推荐阅读