mutecomm / go-sqlcipher

Self-contained Go sqlite3 driver with an AES-256 encrypted sqlite3 database
Other
159 stars 60 forks source link

build error on windows with mingw #2

Closed nkbai closed 7 years ago

nkbai commented 8 years ago

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 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'

frankbraun commented 7 years ago

This should be fixed upstream at https://github.com/mattn/go-sqlite3