I wrote something in go which uses https://github.com/mattn/go-sqlite3 and then I wanted to compile it for a mac on my solus machine, but it doesn't work because it seems like I need a cross compiler. Can anyone help me?
You need to build C compiler with cross compile support. It's documented in the go-sqlite3 README
yursan9 Sorry if this sounds stupid, but where have you read this? The only thing I found was to use CGO_ENABLED=1 and I found that I need a cross compiler in one of the issues on github.
Because it's use cgo, it need C compiler who can cross compile it. I thought it's a general knowledge when using golang library. If you don't want to build a compiler with cross compiler support, you should use pure golang library.
yursan9 No sorry, it wasn't in my case. We didn't learn that at the university. But now I am smarter 🙂
Sorry If I sound condescending, English is not my native language. I'm also an university student, don't worry we can swap knowledge with each other
If it is of interest:
Go can cross compile out of the box. So if that is an option, try this:
GOOS=darwin GOARCH=amd64 go build -a -o myproject .
This is from a makefile for an application I made for Linux, Window and Mac.
DasJott Not if its compiling with CGO. Then you need a C compiler as well and it needs to be able to compile for the target platform.
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project.