🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## 概述 使用 C的go无法直接进行交叉编译(如引用了 odbc lib 库的),可以通过 buildroot 进行 实例:对使用 odbc 的go 程序进行交叉编译 1. 先通过 <快速入门> 编译出目标版本 2. 在目标真机上先编译odbc,并发送到交叉编译环境 ``` 头文件放置 output/host/mips64el-buildroot-linux-gnu/include (include 需要手动创建) 或 output/host/mips64el-buildroot-linux-gnu/sysroot/usr/include/ (未验证) lib 库放到 output/host/mips64el-buildroot-linux-gnu/sysroot/lib/ ``` 3. 编译 ``` GOOS=linux CC="/you/path/buildroot-2018.02.12/output/host/bin/mips64el-linux-gcc" \ GOARCH=mips64le CGO_ENABLED=1 \ go build antbiz.go ```