Libcurl compiling error: "undefined reference to `__mingw_basename'"
<p>This question has already been <a href="https://stackoverflow.com/questions/35835352/get-undefined-reference-to-mingw-basename-errors-while-compiling-curl-7-46-0">asked</a>, but no answers. I am trying to link statically libcurl on Windows with GNU GCC compiler (using last curl version 7.51) I have added ws2_32.a and libcurl.a to the linked libraries with the option <code>-static</code> and in search directories I have included curl\include and the /lib. And I added CURL_STATICLIB in defines.</p>

<p>Build Log:</p>

<pre><code>mingw32-g++.exe -Wall -fexceptions -g -std=c++11 -DCURL_STATICLIB -IC:\Libcurl\static_built\include -IC:\c++\Tutorials\.cbp\libCurl -c C:\c++\Tutorials\.cbp\libCurl\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\Libcurl\static_built\lib -o bin\Debug\libCurl\.exe.exe obj\Debug\main.o  -static  C:\Libcurl\static_built\lib\libcurl.a C:\MinGW\lib\libws2_32.a
C:\Libcurl\static_built\lib\libcurl.a(libcurl_la-formdata.o):formdata.c:(.text+0x491): undefined reference to `__mingw_basename'
collect2.exe: error: ld returned 1 exit status
</code></pre>

<p>Particularly the error:</p>

<pre><code>undefined reference to `__mingw_basename'
</code></pre>