I want use openssl library on UE4 project

I’m making sample for using openssl library for my game. I did add staticlibrary for Unrealengine.

(specifically,

  1. myproject > build settings > search paths > always search user paths : yes

  2. myproject > build settings > search paths > library search paths : /usr/local/Cellar/openssl/1.0.2e_1/lib added

  3. myproject > build settings > search paths > user header search paths : /usr/local/Cellar/openssl/1.0.2e_1/include added

  4. Add libcrypto.a, libssl.a to Frameworks

  5. I added codes like below at MyProject.Build.cs.
    PublicIncludePaths.Add(“/usr/local/Cellar/openssl/1.0.2e_1/include”);
    PublicAdditionalLibraries.Add(“/usr/local/Cellar/openssl/1.0.2e_1/lib/libcrypto.a”);
    PublicAdditionalLibraries.Add(“/usr/local/Cellar/openssl/1.0.2e_1/lib/libssl.a”);

)

but myproject failed to build.
error message was “/usr/local/Cellar/openssl/1.0.2e_1/include/openssl/ossl_typ.h:172:22: error: redefinition of ‘UI’ as different kind of symbol”.

Maybe, “UI” conflicted…

When I emitted 1~3 step, it failed because of same error.

Is there anyone else know to solve this problem??

OS version : OS X El capitan(version 10.11.2)

UE version : 4.9
Xcode : Version 7.2 (7C68)

openssl library version : 1.0.2e_1

I didn’t use default openssl on mac (/usr/local/bin)

1 Like

I solved the problem.
I copied openssl library and header files into subdirectory of my project and then modifed ossl_typ.h.

1 Like