douhuibo5635 2019-02-21 07:52
浏览 232

在mips64le下使用cgo构建静态库

I’m trying to build a libtest.a with Go1.11.4 using cgo under linux/mips64le. I make a simple Go file, this is test.go code:

package main
import(
    “C”
    “fmt”
)

func main() {
}

//export hello
func hello(){
    fmt.Println(“Hello World”)
}

and I did:

CGO_ENABLED=1 go build -o libtest.a -buildmode=c-archive test.go

I get these very non-descriptive errors:

# internal/race
flag provided but not defined: -shared
usage: compile [options] file.go...
(... many options such like -K, -L, -M etc.)
# internal/cpu
(...following like above)
# errors
# runtime/internal/sys
# math/bits
# runtime/internal/atomic
# sync/atomic
# math
# unicode/utf8
# unicode
# runtime/cgo

How can I do it? I can not use cgo under mips64le? best regards

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题