This question has already been asked, 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 -static
and in search directories I have included curl\include and the /lib. And I added CURL_STATICLIB in defines.
Build Log:
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
Particularly the error:
undefined reference to `__mingw_basename'
-lgen
on the command line? – Daniel Stenberg#include <libgen.h>
but still undefined reference to `__mingw_basename' – AndyC:\MinGW\msys\1.0\lib\perl5\vendor_perl\5.8\msys\auto\B\Generate
. After linking it it pops up the same error, wich seem to me that I have linked another library. Where can I find it, if it is not that one? – Andy