Skip to content

Instantly share code, notes, and snippets.

@aa6my
Forked from udnaan/openssl_cross_compile.md
Created December 2, 2022 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aa6my/c8e088b0ee3b24a56d4e0ebc974055a4 to your computer and use it in GitHub Desktop.
Save aa6my/c8e088b0ee3b24a56d4e0ebc974055a4 to your computer and use it in GitHub Desktop.
How to cross compile Openssl 1.1.0 for Windows Host on Ubuntu 14.04 LTS

Install mingw tools on linux:

sudo apt-get install mingw-w64

clone openssl repo:

git clone https://github.com/openssl/openssl.git

Configure openssl for cross compile:

./Configure --cross-compile-prefix=x86_64-w64-mingw32- mingw64

make

@aa6my
Copy link
Author

aa6my commented Dec 2, 2022

Once the compile is done and there are no errors, , do a make install. The resulting files should be in /usr/lib/x86_64-w64-mingw32
Afterwards, the compiler should be able to use the libs and include files by default.
Use -L/usr/lib/x86_64-w64-mingw32 if you are getting linker errors though it might indicate a faulty installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment