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

Not able to compile the code against openssl1.0.2q #127

Closed
srinivasvenu opened this issue Jul 3, 2019 · 2 comments
Closed

Not able to compile the code against openssl1.0.2q #127

srinivasvenu opened this issue Jul 3, 2019 · 2 comments

Comments

@srinivasvenu
Copy link

Hi,
i want to compile the code against openssl1.0 and i'm getting the error's

github.com/spacemonkeygo/openssl

In file included from ./bio.go:17:0:
./shim.h:21:25: fatal error: openssl/bio.h: No such file or directory
compilation terminated.
Is there a way i can compile this code against any openssl version?

@zeebo
Copy link
Member

zeebo commented Jul 3, 2019

Can you tell me more about the details of your system? go env would be useful, for example.

@srinivasvenu
Copy link
Author

I got it resolved by doing the following in my machine.
root@myubuntu:~# uname -a
Linux myubuntu 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

In order to compile the spacemonkey openssl wrapper code for openssl1.0.x version, we need to do the following things
sudo apt-get install libssl-dev
reason:
Most Linux distros install their libraries in two halves. libfoo will contain the actual binary code of the foo library;
this is all you need to run programs that use foo. To compile such programs from source, you also need the library headers, which come in a package called libfoo-dev (Debian family) or libfoo-devel (Fedora family).
libfoo is often installed by default; libfoo-dev is not.

you need to copy libcrypto.pc,libssl.pc and openssl.pc files to pkgconfig location
cp /tmp/openssl.pc /tmp/libcrypto.pc /tmp/libssl.pc /usr/lib/x86_64-linux-gnu/pkgconfig/

root@myubuntu:/tmp# cat /tmp/libcrypto.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include
enginesdir=${libdir}/engines-1.1

Name: OpenSSL-libcrypto
Description: OpenSSL cryptography library
Version: 1.0.0
Libs: -L${libdir} -lcrypto
Libs.private: -ldl -pthread
Cflags: -I${includedir}

root@myubuntu:/tmp# cat /tmp/libssl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include

Name: OpenSSL-libssl
Description: Secure Sockets Layer and cryptography libraries
Version: 1.0.0
Requires.private: libcrypto
Libs: -L${libdir} -lssl
Cflags: -I${includedir}

root@myubuntu:/tmp# cat openssl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include

Name: OpenSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Version: 1.0.0
Requires: libssl libcrypto

@zeebo zeebo closed this as completed Jul 4, 2019
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

2 participants