Newb here. I'm in over my head. Using a Win10/amd64 PowerShell with Go 
v1.12.6. Trying to cross-compile
to FreeBSD/amd64. go env = GOARCH=amd64 & GOOS=freebsd. Source includes 
calls to SQLite3. Compiles
without errors.

Resulting binary fails on FreeBSD with: "Can't connect to the SQLite DB 
Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work."

Added CGO_ENABLED=1 to the go env.  Recompile fails to build a binary and 
yields this error stream:

"# runtime/cgo
_cgo_export.c:1:0: error: -fPIC ignored for target (all code is position 
independent) [-Werror]
 /* Code generated by cmd/cgo; DO NOT EDIT. */
 ^
cc1.exe: all warnings being treated as errors"

I have no idea what that means.

Same source compiled for the Win10 machine runs perfectly. If I copy the 
source code over to a
FreeBSD box with Go installed there and compile, it works fine. It is the 
cross-compilation that
doesn't seem to work.

This isn't a Go problem, it is something I'm not understanding about 
cross-compiling

Any thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ebe9fe0d-7727-40b9-bc53-a9d237faecf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to