Closed shishuwu closed 4 years ago
golang-migrate depends on github.com/mattn/go-sqlite3. Both github.com/mattn/go-sqlite3 and go-sqlcipher have an embedded sqlite3 database. When the linker wants to build your binary you get the error above.
I know that you can somehow get go-sqlite3 to use an external sqlite3 library instead of the included one, but I don't know if you can get it to use the one included in go-sqlcipher.
A hackish way to fix your problem would be to fork golang-migrate and replace go-sqlite3 with go-sqlcipher. Make sure you use the latest head of go-sqlcipher to have full go-sqlite3 compatibility.
Since there doesn't seem to be anything that can be done from the go-sqlcipher side I'm closing the issue.
I'm leveraging golang-migrate to do database schema init & update. Aligned with go-sqlcipher, it always pops up the following error:
# command-line-arguments c:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ADMINI~1\AppData\Local\Temp\go-link-302618435\000053.o: in function
sqlite3_status64': C:\Users\Administrator\go\pkg\mod\github.com\mattn\go-sqlite3@v1.10.0/sqlite3-binding.c:20370: multiple definition ofsqlite3_status64'; C:\Users\ADMINI~1\AppData\Local\Temp\go-link-302618435\000033.o:C:\Users\Administrator\go\pkg\mod\github.com\mutecomm\go-sqlcipher\v4@v4.4.0/sqlite3.c:26352: first defined here C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ADMINI~1\AppData\Local\Temp\go-link-302618435\000053.o: in function
sqlite3_status': C:\Users\Administrator\go\pkg\mod\github.com\mattn\go-sqlite3@v1.10.0/sqlite3-binding.c:20390: multiple definition ofsqlite3_status'; C:\Users\ADMINI~1\AppData\Local\Temp\go-link-302618435\000033.o:C:\Users\Administrator\go\pkg\mod\github.com\mutecomm\go-sqlcipher\v4@v4.4.0/sqlite3.c:26372: first defined here C...