F
F
Festelo2017-02-02 16:42:35
go
Festelo, 2017-02-02 16:42:35

How to fix "sql: unknown driver "sqlite3" (forgotten import?)" when cross compiling from Windows to Linux?

Good afternoon! Error when running Windows compiled file on linux machine:
sql: unknown driver "sqlite3" (forgotten import?)
Everything works fine on Windows
Tried driver github.com/mattn/go-sqlite3 and github.com/mxk/go-sqlite /
Compiling:

set GOOS=linux 
go build entry.go

Code: pastebin.com/8iqvhp1n
Go 1.7.4, Windows 10, Ubuntu 16.04.1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
om1058, 2017-02-02
@om1058

Compile natively. At least this is the easiest option.
go-sqlite3 - despite the name, it is not written in pure GO, but using CGO. And for cross-compilation, skills will be required, respectively.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question