Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The installation is failing on windows, may be because it's not been tested i believe. #1

Open
mrtinkz opened this issue Jul 22, 2016 · 12 comments

Comments

@mrtinkz
Copy link

mrtinkz commented Jul 22, 2016

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.

@vijaygiri10
Copy link

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

@drwasho
Copy link

drwasho commented Jul 26, 2016

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

@xjj1
Copy link

xjj1 commented Aug 26, 2016

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?

@vijaygiri10
Copy link

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])

@JinWuZhao
Copy link

But I need to build 64bit program. How can I do?

@JinWuZhao
Copy link

@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.😁

@JinWuZhao
Copy link

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'

@vijaygiri10
Copy link

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

@JinWuZhao
Copy link

JinWuZhao commented Jan 19, 2017

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.

@JinWuZhao
Copy link

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.

@gjrtimmer
Copy link
Contributor

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.

@JinWuZhao
Copy link

That's great. Well done!

xeodou pushed a commit that referenced this issue May 23, 2018
Bring master up-to-date
xeodou pushed a commit that referenced this issue May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants