curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: MinGW Cross-Compiling results in error "ld: cannot find -link"

From: René Berber via curl-library <>
Date: Wed, 30 Oct 2019 13:47:32 -0600

On 10/29/2019 8:10 AM, Michael Fabian Dirks via curl-library wrote:
> On 29/10/2019 03:35, René Berber via curl-library wrote:

>> Building from the tar.xz (or equivalent) does already have a useful
>> configure file.
> I am getting the same result with a build from a source archive instead
> of using 'git clone ...'. However I did manage to get it to work by
The problem is that configure defaulted to the MS linker, its very clear
if you take a look at config.log; furthermore its in the configure
script (with some context):

> *)
> # Assume MSVC wrapper
> hardcode_libdir_flag_spec=' '
> allow_undefined_flag=unsupported
> # Tell ltmain to make .lib files, not .a files.
> libext=lib
> # Tell ltmain to make .dll files, not .so files.
> shrext_cmds=".dll"
> # FIXME: Setting linknames here is a bad hack.
> archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
> # The linker will automatically build a .lib file if we build a DLL.

There's the sed command (after the FIXME).

Now you only need to figure out why configure didn't find the GNU
linker, which again should be clear by looking at config.log .

Wild guess: Its not properly named, mine is
i686-w64-mingw32.static-ld.exe (and all the tools have the cross target
in the name, which is something MXE takes care off).

R. Berber
Received on 2019-10-30