The installation is failing on windows, may be because it's not been tested i believe.
I have the gcc properly installed. But looks like there seems to be an issue while installing go-sqlchiper. Has anyone tried to install the new release on windows yet. Any help is greatly appreciated. Thanks
go get github.com/xeodou/go-sqlcipher
github.com/xeodou/go-sqlcipher
....\workspace\src\github.com\xeodou\go-sqlcipher\sqlite3-binding.c:18280:26: fatal error: openssl/rand.h: No such file or directory #include <openssl/rand.h> ^ compilation terminated.
hi, I got the same error. You can download openssl from here http://slproweb.com/products/Win32OpenSSL.html Notice: You need download the full version
1.)After that go to this path ->C:\OpenSSL-Win32\include and copy openssl folder and place it to C:\TDM-GCC-64\include\ if you are using TDM-GCC 2.)Rename these two file libeay32.a and libeay32.def will be present at C:\OpenSSL-Win32\lib to libcrypto.a and libcrypto.def and place libcrypto.a and libcrypto.def to C:\TDM-GCC-64\lib\
Then do go get github.com/xeodou/go-sqlcipher
you wouldn't get any error
This is what I got:
# github.com/xeodou/go-sqlcipher
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcrypto
collect2.exe: error: ld returned 1 exit status
Hi,
I got the same error, and followed the steps above.
This is what I got :
d:\develop\go\src>go get github.com/xeodou/go-sqlcipher
# github.com/xeodou/go-sqlcipher
d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-min
gw32/bin/ld.exe: skipping incompatible d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-m
ingw32/5.1.0/../../../../lib/libcrypto.a when searching for -lcrypto
d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-min
gw32/bin/ld.exe: skipping incompatible d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-m
ingw32/5.1.0/../../../../lib\libcrypto.a when searching for -lcrypto
d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-min
gw32/bin/ld.exe: skipping incompatible d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-m
ingw32/5.1.0/../../../libcrypto.a when searching for -lcrypto
d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-min
gw32/bin/ld.exe: skipping incompatible d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-m
ingw32/5.1.0/../../..\libcrypto.a when searching for -lcrypto
d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-min
gw32/bin/ld.exe: skipping incompatible d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-m
ingw32/5.1.0/../../../../lib/libcrypto.a when searching for -lcrypto
d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-min
gw32/bin/ld.exe: skipping incompatible d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-m
ingw32/5.1.0/../../../libcrypto.a when searching for -lcrypto
d:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-min
gw32/bin/ld.exe: cannot find -lcrypto
collect2.exe: error: ld returned 1 exit status
Maybe it is trying to compile for 64bit while having a 32bit library?
you are Right about compile for 64bit while having a 32bit library. Please tying go1.7 32 bit please do not forget to follow the steps i mentioned above. If still not able compile please feel free to mail me ([email protected])
But I need to build 64bit program. How can I do?
@vijaygiri10 That PKG has a bad performance problem and the xeodou's works very well.I just have to solve the issue of compilation on windows.😁
Now I stuck there:
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xd8b): undefined reference to __imp_GetDeviceCaps' C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xdb8): undefined reference to __imp_CreateCompatibleBitmap'
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xdce): undefined reference to __imp_GetObjectW' C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xe91): undefined reference to __imp_GetDIBits'
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xf20): undefined reference to `__imp_DeleteObject'
I tried in GO 1.6 32bit (windows10,windows7 64 bit OS)
You can download openssl from here http://slproweb.com/products/Win32OpenSSL.html
Rename these two file( libeay32.a) and (libeay32.def) to libcrypto.a and libcrypto.def
These two file( libeay32.a) and (libeay32.def) will be present at where you install openssl.
For me it is ->C:\OpenSSL-Win32\lib\
When you rename above file, please place them to C:\TDM-GCC-64\lib\
Then do go get github.com/xeodou/go-sqlcipher
you wouldn't get any error
Thanks $ Regards
I figure out it.
I modified the sqlite3_windows.go and added '-lgdi32' behind the LDFLAGS.
Like this:

Then I recompiled the libcrypto.a of OpenSSL 64bit and put it into C:\TDM-GCC-64\lib.
If you want to build 32bit binary with 64bit go compiler and TDMGCC. Just recompile a 32bit libcrypto.a from OpenSSL. Then put it into C:\TDM-GCC-64\lib. DO NOT USE the distribution of http://slproweb.com/products/Win32OpenSSL.html, that doesn't work. And don't use the OpenSSL of 1.1.x version. Because that's not compatible with old version.
See Issue #5 I've written a complete complication manual for how to compile on Windows 64bit. I do have to submit a PR for a minor change. Also this manual should probably go in some README or something. But first check it out and verify it also works on your environment.
That's great. Well done!