spacemonkeygo / openssl

OpenSSL bindings for Go
http://godoc.org/github.com/spacemonkeygo/openssl
Apache License 2.0
473 stars 236 forks source link

getting fatal error: 'openssl/bio.h' file not found on m1 mac #148

Closed nurjamil closed 2 years ago

nurjamil commented 2 years ago

In file included from ../../pkg/mod/github.com/spacemonkeygo/openssl@v0.0.0-20181017203307-c2dcc5cca94a/bio.go:17: ./shim.h:21:10: fatal error: 'openssl/bio.h' file not found

include <openssl/bio.h>

     ^~~~~~~~~~~~~~~

1 error generated.

Ive already install pkgconfig export LDFLAGS="-L/opt/homebrew/opt/openssl/lib" export CPPFLAGS="-I/opt/homebrew/opt/openssl/include" export PATH="/opt/homebrew/opt/openssl/bin:$PATH" export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl/lib/pkgconfig"

pkg-config --variable=includedir openssl

nurjamil commented 2 years ago

solved:

export CGO_LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib" export CGO_CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

johansetia commented 1 year ago

solved:

export CGO_LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib" export CGO_CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

sorry. i got this errors and how to fix it

ld: warning: ignoring file /opt/homebrew/opt/openssl@1.1/lib/libssl.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/openssl@1.1/lib/libcrypto.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64