-1

I am try compile OpenSSL for WP 8.0 using this repo. https://github.com/Microsoft/openssl

How i do it:

  1. Execute the following script in the source root tree.

    ms\do_vsprojects.bat

  2. Open visual studio solution created

    vsout\openssl.sln

  3. Run Unit Test App Projects

  4. ms\do_packwinapp.bat

Finally i got two dlls ssleay32.dll and libeay32.dll from path "\openssl\vsout\package\bin\Phone\8.0\Dll\Unicode\Release\arm". I am trying to add this dlls into my WP8.0 project, and i get error:

"A reference to a higher version or incompatible assembly cannot be added to the project."

What am i doing wrong?

jww
  • 97,681
  • 90
  • 411
  • 885
lineelik
  • 1
  • 3
  • Possible duplicate of [Build native OpenSSL library for WP8 Platform](http://stackoverflow.com/questions/24322250/build-native-openssl-library-for-wp8-platform) – jww May 26 '15 at 01:26
  • OpenSSL currently does not compile for Windows Phone or Windows RT. Or maybe the better way to phrase it is, "its not officially supported". See, for example, [Where is sockaddr_in in Windows RT?](http://stackoverflow.com/q/18120275). I have a bunch of patches for it, but it was very painful. – jww May 26 '15 at 01:30
  • Protip: you can't simply compile random applications so they run on the windows phone platform. –  May 26 '15 at 16:33

2 Answers2

0

These libraries have been compiled for the target platform other than the Windows Phone.

See the build options for these libraries in VS.

user2784555
  • 299
  • 2
  • 9
0

You are trying to link these C++ .dll directly to your C# code (to verify this, i tried the same in VS and got the same error). This will not work.

What you need to do is to create a C++ project in your C# phone solution. In VS 2015, right click solution -> Add New Project -> Visual C++ -> Windows -> Windows 8 -> Windows Phone -> Windows Runtime Component (there are multiple options for 8.0/8.1/silverlight). choose the one that matches your phone app).

In this new c++ based windows phone runtime component project you will be able to write and call c++ code. OpenSSL dlls need to be linked to this c++ project.

I just tried to link openssl static libraries in my windows phone project and it worked (took a while, but it worked).

You should be able to find more information on how to write C++ code for a windows phone app on google. This may be a good place to start: https://msdn.microsoft.com/en-us/library/windows/apps/hh441569%28v=vs.110%29.aspx

vishalb
  • 63
  • 6