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

Building Wallet example (from workspace) - throws <unknown>:0: error: could not build Objective-C module 'crypto' - 'openssl/e_os2.h' file not found #3

Closed
johndpope opened this issue Feb 5, 2018 · 12 comments

Comments

@johndpope
Copy link

screen shot 2018-02-05 at 11 40 47 am

I'm targeting ios 11 - (not ios 11.2)
seems like there's a specific openssl version required.
https://github.com/ZBK1nger/bither-iOS/blob/fd9646362483216b580f6f41151845ef4abb7608/Podfile

@johndpope
Copy link
Author

think this is a side effect of the path not setup correctly on #3

@johndpope johndpope reopened this Feb 5, 2018
@johndpope
Copy link
Author

/Users/johndpope/Documents/cryptoWorkspace/BitcoinKit/Libraries/crypto/include/openssl/bn.h:129:11: error: 'openssl/e_os2.h' file not found

include <openssl/e_os2.h>

@johndpope johndpope changed the title 'openssl/e_os2.h' file not found <unknown>:0: error: could not build Objective-C module 'crypto' - 'openssl/e_os2.h' file not found Feb 5, 2018
@johndpope
Copy link
Author

believe this is related to
carthage update --platform iOS --no-use-binaries

@johndpope johndpope reopened this Feb 6, 2018
@johndpope
Copy link
Author

going to try brew upgrade

@johndpope johndpope changed the title <unknown>:0: error: could not build Objective-C module 'crypto' - 'openssl/e_os2.h' file not found Building Wallet example (from workspace) - throws <unknown>:0: error: could not build Objective-C module 'crypto' - 'openssl/e_os2.h' file not found Feb 6, 2018
@kishikawakatsumi
Copy link
Contributor

kishikawakatsumi commented Feb 6, 2018

@johndpope Can you make sure you’re using V0.1.1 or master? Homebrew is unlikely cause of the issue. libcrypto is built from source automatically as dependency

@johndpope
Copy link
Author

Errors Installing the "cryptography" Package
If you see the error shown below on OS X, then there was an issue installing the cryptography package.

build/temp.macosx-10.10-x86_64-2.7/_openssl.c:423:10: fatal error: 'openssl/e_os2.h' file not found
#include <openssl/e_os2.h>
To fix this issue, try upgrading Xcode Command Line Tools:

$ xcode-select --install
Then, make sure that openssl is installed and re-link it:

$ brew install openssl
$ brew link openssl --force

https://github.com/blockstack-packages/blockstack-profiles-py/blob/8d76651959847aa49c8e1d0714da4407c19c0cd4/troubleshooting.md

found this - it's out of date.

➜ BitcoinKit git:(btc) ✗ brew link --force openssl
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

@johndpope
Copy link
Author

brew info openssl
openssl: stable 1.0.2n (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/openssl/1.0.2l (1,701 files, 12.2MB)
Built from source on 2017-09-09 at 20:27:15
/usr/local/Cellar/openssl/1.0.2m (1,792 files, 12.3MB)
Poured from bottle on 2017-11-06 at 12:40:57
/usr/local/Cellar/openssl/1.0.2n (1,792 files, 12.3MB)
Poured from bottle on 2018-02-06 at 12:15:02
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb
==> Dependencies
Build: makedepend ✔
==> Options
--without-test
Skip build-time tests (not recommended)
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs

and run
/usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

@johndpope
Copy link
Author

openssl version -a
OpenSSL 1.0.2n 7 Dec 2017
built on: reproducible build, date unspecified
platform: darwin64-x86_64-cc
options: bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: x86_64-apple-darwin13.4.0-clang -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/johndpope/miniconda3/include -I. -I.. -I../include -fPIC -fno-common -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/Users/johndpope/miniconda3/ssl"

@kishikawakatsumi
Copy link
Contributor

No need to install OpenSSL to use this library. Can you try clone the repo then just build it?

@johndpope
Copy link
Author

I'm on latest branch - bitcoinkit compiles fine - but with wallet - this is similar error I get.
screen shot 2018-02-06 at 12 20 52 pm

I'm using iterm / zsh / mini conda - could have something to do with it.
will keep digging.

@johndpope
Copy link
Author

screen shot 2018-02-06 at 12 27 01 pm

joy. adding /usr/local/opt/openssl/include + /usr/local/opt/openssl/lib to header search path resolved this for me. not ideal I guess - but finally up and running.
happy to leave this open until a better solution arises.
or can close.

@kishikawakatsumi
Copy link
Contributor

Hmm, it seems something wrong my side. I'll investigate it. Thank you for reporting!

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