Closed nkbai closed 7 years ago
go get github.com/mutecomm/go-sqlcipher report many errors about pthread, you can just modify sqlite3_windows.go
such as: crypt_cipher_is_valid.c:25: undefined reference to _imp__pthread_mutex_lock' crypt_cipher_is_valid.c:30: undefined reference to_imppthread_mutex_unlock' crypt_cipher_is_valid.c:27: undefined reference to `_imppthread_mutex_unlock' crypt_find_cipher.o: In functionfind_cipher': crypt_find_cipher.c:27: undefined reference to_imppthread_mutex_lock' crypt_find_cipher.c:30: undefined reference to_imp__pthread_mutex_unlock' crypt_find_cipher.c:34: undefined reference to_imppthread_mutex_unlock' crypt_find_hash.o: In functionfind_hash': crypt_find_hash.c:27: undefined reference to_imppthread_mutex_lock' crypt_find_hash.c:30: undefined reference to_imp__pthread_mutex_unlock' crypt_find_hash.c:34: undefined reference to_imppthread_mutex_unlock' crypt_hash_is_valid.o: In functionhash_is_valid': crypt_hash_is_valid.c:25: undefined reference to_imppthread_mutex_lock' crypt_hash_is_valid.c:30: undefined reference to`_imppthread_mutex_unlock' crypt_hash_is_valid.c:27: undefined reference to _imp__pthread_mutex_unlock' crypt_register_cipher.o: In functionregister_cipher': crypt_register_cipher.c:30: undefined reference to _imp__pthread_mutex_lock' crypt_register_cipher.c:42: undefined reference to_imppthread_mutex_unlock' crypt_register_cipher.c:48: undefined reference to _imp__pthread_mutex_unlock' crypt_register_hash.o: In functionregister_hash': crypt_register_hash.c:30: undefined reference to _imp__pthread_mutex_lock' crypt_register_hash.c:42: undefined reference to_imppthread_mutex_unlock' crypt_register_hash.c:48: undefined reference to _imp__pthread_mutex_unlock' crypt_register_prng.o: In functionregister_prng': crypt_register_prng.c:30: undefined reference to `_imp__pthread_mutex_lock'
_imp__pthread_mutex_lock' crypt_cipher_is_valid.c:30: undefined reference to
find_cipher': crypt_find_cipher.c:27: undefined reference to
_imp__pthread_mutex_unlock' crypt_find_cipher.c:34: undefined reference to
find_hash': crypt_find_hash.c:27: undefined reference to
_imp__pthread_mutex_unlock' crypt_find_hash.c:34: undefined reference to
hash_is_valid': crypt_hash_is_valid.c:25: undefined reference to
_imp__pthread_mutex_unlock' crypt_register_cipher.o: In function
_imp__pthread_mutex_lock' crypt_register_cipher.c:42: undefined reference to
_imp__pthread_mutex_unlock' crypt_register_hash.o: In function
_imp__pthread_mutex_lock' crypt_register_hash.c:42: undefined reference to
_imp__pthread_mutex_unlock' crypt_register_prng.o: In function
This should be fixed upstream at https://github.com/mattn/go-sqlite3
go get github.com/mutecomm/go-sqlcipher report many errors about pthread, you can just modify sqlite3_windows.go
cgo LDFLAGS: -lmingwex -lmingw32 add -lpthread at this line
such as: crypt_cipher_is_valid.c:25: undefined reference to
_imp__pthread_mutex_lock' crypt_cipher_is_valid.c:30: undefined reference to
_imppthread_mutex_unlock' crypt_cipher_is_valid.c:27: undefined reference to `_imppthread_mutex_unlock' crypt_find_cipher.o: In functionfind_cipher': crypt_find_cipher.c:27: undefined reference to
_imppthread_mutex_lock' crypt_find_cipher.c:30: undefined reference to_imp__pthread_mutex_unlock' crypt_find_cipher.c:34: undefined reference to
_imppthread_mutex_unlock' crypt_find_hash.o: In functionfind_hash': crypt_find_hash.c:27: undefined reference to
_imppthread_mutex_lock' crypt_find_hash.c:30: undefined reference to_imp__pthread_mutex_unlock' crypt_find_hash.c:34: undefined reference to
_imppthread_mutex_unlock' crypt_hash_is_valid.o: In functionhash_is_valid': crypt_hash_is_valid.c:25: undefined reference to
_imppthread_mutex_lock' crypt_hash_is_valid.c:30: undefined reference to`_imppthread_mutex_unlock' crypt_hash_is_valid.c:27: undefined reference to_imp__pthread_mutex_unlock' crypt_register_cipher.o: In function
register_cipher': crypt_register_cipher.c:30: undefined reference to_imp__pthread_mutex_lock' crypt_register_cipher.c:42: undefined reference to
_imppthread_mutex_unlock' crypt_register_cipher.c:48: undefined reference to_imp__pthread_mutex_unlock' crypt_register_hash.o: In function
register_hash': crypt_register_hash.c:30: undefined reference to_imp__pthread_mutex_lock' crypt_register_hash.c:42: undefined reference to
_imppthread_mutex_unlock' crypt_register_hash.c:48: undefined reference to_imp__pthread_mutex_unlock' crypt_register_prng.o: In function
register_prng': crypt_register_prng.c:30: undefined reference to `_imp__pthread_mutex_lock'