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

Error "unknown type name 'BN_ULONG'" while building project on simulator #72

Closed
VNKorchagin opened this issue Jul 29, 2019 · 11 comments · Fixed by #73
Closed

Error "unknown type name 'BN_ULONG'" while building project on simulator #72

VNKorchagin opened this issue Jul 29, 2019 · 11 comments · Fixed by #73

Comments

@VNKorchagin
Copy link

When i try to build project in XCode (Version 10.2.1) on simulator i get the error:

In file included from [path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/pkcs7.h:62:
In file included from [path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/asn1.h:74:
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:314:5: error: unknown type name 'BN_ULONG'
BN_ULONG d; / Pointer to an array of 'BN_BITS2' bit
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:330:5: error: unknown type name 'BN_ULONG'
BN_ULONG n0[2]; /* least significant word(s) of Ni; (type
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:487:22: error: a parameter list without types is only allowed in a function definition
int BN_num_bits_word(BN_ULONG);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:535:1: error: unknown type name 'BN_ULONG'
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:535:39: error: unknown type name 'BN_ULONG'
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:536:1: error: unknown type name 'BN_ULONG'
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:536:33: error: unknown type name 'BN_ULONG'
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:537:28: error: unknown type name 'BN_ULONG'
int BN_mul_word(BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:538:28: error: unknown type name 'BN_ULONG'
int BN_add_word(BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:539:28: error: unknown type name 'BN_ULONG'
int BN_sub_word(BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:540:28: error: unknown type name 'BN_ULONG'
int BN_set_word(BIGNUM *a, BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:541:1: error: unknown type name 'BN_ULONG'
BN_ULONG BN_get_word(const BIGNUM *a);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:557:37: error: unknown type name 'BN_ULONG'
int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:596:24: error: unknown type name 'BN_ULONG'
void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:914:1: error: unknown type name 'BN_ULONG'
BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:914:27: error: unknown type name 'BN_ULONG'
BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:914:47: error: unknown type name 'BN_ULONG'
BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:915:27: error: unknown type name 'BN_ULONG'
BN_ULONG w);
^
[path to project]Pods/Headers/Public/OpenSSL-Universal/openssl/bn.h:916:1: error: unknown type name 'BN_ULONG'
BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

The project is compile successfully on a real device.
I suspect that needs to make changes to "Build Settings". How I can fix this error?

@VNKorchagin
Copy link
Author

I make this changes

Screenshot 2019-07-29 at 12 19 11

Screenshot 2019-07-29 at 12 18 55

but it's doesn't work

@krzyzanowskim
Copy link
Owner

you shouldn't need to change anything. Cocoapods should do all the changes. Maybe something with Pods integration is not right in the project?

@VNKorchagin
Copy link
Author

I tried:

pod deintegrate
pod clean
pod install

But that didn't fix the problem.
I can't understand why the project is successfully building on a real device, but not building on the simulator.

What do these mistakes mean? If I understand correctly: my project does not see the constant BN_ULONG

@krzyzanowskim
Copy link
Owner

krzyzanowskim commented Jul 29, 2019

It can't find the path to headers, this is managed by Pods scheme config. Are you sure you didn't override this setting somewhere? Are you able to reproduce the issue with the just created new project?

@VNKorchagin
Copy link
Author

I can't reproduce this error on new project.
I will do additional research to identify the causes of the error.

@tiagomnh
Copy link

tiagomnh commented Sep 4, 2019

Have you found a solution @VNKorchagin?

I'm having the same issue but only when building for the simulator of 32-bit devices. For 64-bit it builds successfully.

@VNKorchagin
Copy link
Author

Have you found a solution?

No, I did not find any solution to this problem. I suspect that I need to make some changes to the project settings, but I don’t know which ones.
If I need to run the app on the simulator, then I just change pod for OpenSSL (as a temporary solution).

@ilammy
Copy link
Contributor

ilammy commented Sep 17, 2019

Just chiming in. The issue seems to be actual for Carthage projects as well. Build fails with the same errors when compiling code using OpenSSL, but the OpenSSL project itself seems to build successfully.

@OrfeasZ
Copy link
Contributor

OrfeasZ commented Sep 18, 2019

I encountered this problem as well. It looks like this project doesn't include a configuration for the 32-bit version of the simulator. I've forked it and added support for the 32-bit iOS simulator in this repo (and also updated to OpenSSL 1.0.2t). You can use directly with CocoaPods like this:

pod 'OpenSSL-Universal', :git => 'https://github.com/OrfeasZ/OpenSSL.git'

If you want to build it yourself, simply clone it, ensure you have XCode and Carthage installed (regardless of whether you're planning on using it or not), and run build.sh in the main project directory.

@krzyzanowskim I can send a PR your way if this is something you're interested in merging into this repo.

@dalia89
Copy link

dalia89 commented Feb 12, 2021

rename Podfile.Lock --> pod 'OpenSSL-Universal', '~>1.0.2.20' paste this in Podfile --> open terminal --> cd ios --> pod install

@adityasingh773
Copy link

For me, the issue was related to older Cocoapods version, updating my cocoapods fixed it
sudo gem install cocoapods

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

Successfully merging a pull request may close this issue.

7 participants