How to Build Openssl with Mingw in Windows

How to build OpenSSL with MinGW in Windows?

This is an extract from a personal how-to I wrote. It has since been transformed to a script (look at the OpenSSL section, obviously). It assumes you have a working installation of MinGW and that you have a working MSys console.



OpenSSL

To build OpenSSL, you need a working Perl installation.

Download OpenSSL from its official website and decompress the archive.

Windows 32/64 bits - MinGW

You must run these commands from a MSys console.

For 32 bits:

perl Configure mingw no-shared no-asm --prefix=/c/OpenSSL

For 64 bits:

perl Configure mingw64 no-shared no-asm --prefix=/C/OpenSSL-x64

Then:

make depend

make

make install

The make depend line is only needed on the most recent OpenSSL version if you specified any of the no-... options.

Note that this will compile OpenSSL in static mode.

If at some point you get a "make (e=2):" error, ensure you don't have another "make.exe" in your PATH or just type /bin/make instead of make.


You may, of course, need to compile it with other options (such as dynamic linking, or asm enabled). So feel free to look at the help perl Configure can provide to know more about the available options.

Compile OpenSSL MinGw on windows - make[1]: *** [Makefile:2800: crypto/dso/dso_win32.o] Error 1

I finnaly found the answer, I was using the wrong gcc (not the mingw one) because of the export PATH of MSYS2.

I did

which gcc

and it gave me the wrong path so doing

export PATH="/path to msys/msys2/mingw32/bin:$PATH"

did the trick.

If anyone is having the same issue, hope this helps.

How to compile fips for mingw compiler?

Got the solution..fixed this by downgrading MingW's w32api
(mingw-get upgrade "w32api<5.0.2")

Refer this : github.com/openssl/openssl/issues/5327

build openssl on win64 fail

To build openssl on win64 it's easier to use their native Visual C++ 2015 Build Tools.Use VS native tools command is recommended,found detail in this answer.If the vcvar32.bat doesn't work,refer this answer to modify it.The .Net version reference is here.After all these I built openssl-1.0.2k on Win64/x64 finally.



Related Topics



Leave a reply



Submit