Hi all. i got the solution. i hope it can help someone like me .
1. install tdm64-gcc
2. download the source code of sqlite3
5. change sqlite3.go
1) delete "#cgo pkg-config: sqlite3"
2) change #include <sqlite3.h> to #include "sqlite3.h"
3) add
#cgo windows LDFLAGS: -lmingwex -lmingw32
#cgo windows CFLAGS: -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
6. go install github.com/mattn/go-sqlite3 and test it
the final sqlite3.go's beginning like this:
package sqlite
/*
#include "sqlite3.h"
#include <stdlib.h>
#include <string.h>
#cgo windows LDFLAGS: -lmingwex -lmingw32
#cgo windows CFLAGS: -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
static int
_sqlite3_bind_text(sqlite3_stmt *stmt, int n, char *p, int np) {
return sqlite3_bind_text(stmt, n, p, np, SQLITE_TRANSIENT);
}
static int
_sqlite3_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) {
return sqlite3_bind_blob(stmt, n, p, np, SQLITE_TRANSIENT);
}
*/
import "C"
....
//====================================================