2

I need to compile App.exe on ubuntu 16. I installed mingw-w64, openssl and curl:

sudo apt-get install mingw-w64
wget http://www.openssl.org/source/openssl-1.0.2k.tar.gz
tar -xzvf openssl-1.0.2k.tar.gz
cd openssl-1.0.2k/
./Configure mingw64 shared --cross-compile-prefix=x86_64-w64-mingw32- --prefix=/usr/x86_64-w64-mingw32/
make
sudo make install
cd ..
wget https://curl.haxx.se/download/curl-7.53.1.tar.gz
tar -xzvf curl-7.53.1.tar.gz
cd curl-7.53.1/
./configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build=i686-pc-linux-gnu --prefix=/usr/x86_64-w64-mingw32 --enable-static --disable-shared --with-ssl --with-zlib
make
sudo make install
cd ..
x86_64-w64-mingw32-g++ -v -o test.exe test.cpp -static -DCURL_STATICLIB -lcurl

Installation is performed without errors, but when compiling:

x86_64-w64-mingw32-g++ -v -o test.exe test.cpp -static -DCURL_STATICLIB -lcurl

test.cpp:

#include <iostream>
#include <curl/curl.h>

using namespace std;

int main(int argc, char **argv)
{
    cout << curl_version() << endl;
    return 0;
}

compiler other errors:

    ...

    /usr/lib/gcc/x86_64-w64-mingw32/5.3-win32/../../../../x86_64-w64-mingw32/lib/libcurl.a(libcurl_la-curl_ntlm_core.o):curl_ntlm_core.c:(.text+0x202): undefined reference to `DES_ecb_encrypt'
    /usr/lib/gcc/x86_64-w64-mingw32/5.3-win32/../../../../x86_64-w64-mingw32/lib/libcurl.a(libcurl_la-curl_ntlm_core.o):curl_ntlm_core.c:(.text+0x2fe): undefined reference to `MD4_Init'
    /usr/lib/gcc/x86_64-w64-mingw32/5.3-win32/../../../../x86_64-w64-mingw32/lib/libcurl.a(libcurl_la-curl_ntlm_core.o):curl_ntlm_core.c:(.text+0x30c): undefined reference to `MD4_Update'
    /usr/lib/gcc/x86_64-w64-mingw32/5.3-win32/../../../../x86_64-w64-mingw32/lib/libcurl.a(libcurl_la-curl_ntlm_core.o):curl_ntlm_core.c:(.text+0x317): undefined reference to `MD4_Final'
    collect2: error: ld returned 1 exit status

I do not know where I'm wrong. You do?

jww
  • 97,681
  • 90
  • 411
  • 885
  • 2
    OpenSSL 1.0.2 or 1.1.0 may have removed MD4 by default, and you may need to configure with `enable-md4`. Also see [Linking OpenSSL libraries to a program](http://stackoverflow.com/q/4352573/608639) – jww Mar 14 '17 at 14:55

0 Answers0