aleroot
aleroot

Reputation: 72676

Can't cross compile(windows) a program that link ssl library

I have a C program that link the ssl library(md5.h) :

#if defined(__APPLE__)
#  define COMMON_DIGEST_FOR_OPENSSL
#  include <CommonCrypto/CommonDigest.h>
#  define SHA1 CC_SHA1
#else
#  include <openssl/md5.h>
#endif

every thing works fine on Linux and Mac Os X, compiling with this command line :

gcc program.c -o prog -lssl

Now i want to compile it for windows, so i have installed MinGw on my Debian, and i'm trying to cross compile with this command line :

i586-mingw32msvc-gcc program.c -o program.exe -lssl

but i get this compilation error :

error: openssl/md5.h: No such file or directory

Why? How can i solve this problem ?

Upvotes: 0

Views: 1765

Answers (2)

Alecs
Alecs

Reputation: 2316

Check all paths in makefile.m32 files, there must be something wrong with them.

And AFAIR you must compile it not in cmd, but in mingw-cmd, that installs along with mingw package.

Upvotes: 0

rubenvb
rubenvb

Reputation: 76785

You need OpenSSL built for Windows where the compiler can find it. The easiest way is to build from source, and install into a prefix the mingw compiler can find it (or pass the include and library paths to your build system).

OpenSSL is a third party lib, so it's not part of the mingw package.

Upvotes: 2

Related Questions