我想在我的项目中使用curl (windows上的c++ QT创建者),我从网站https://curl.se/download.html (Version7.82.0)下载压缩库文件,我想使用Makefile和这个推荐的mingw32-make mingw32构建它,如文档https://curl.se/docs/install.html所描述的那样。
但不幸的是,我遇到了一个错误
mingw32-make mingw32
[....]
gcc -s -m32 -static -o curl.exe curl.res slist_wc.o tool_binmode.o tool_bname.o
tool_cb_dbg.o tool_cb_hdr.o tool_cb_prg.o tool_cb_rea.o tool_cb_see.o tool_cb_wrt.o
tool_cfgable.o tool_dirhie.o tool_doswin.o tool_easysrc.o tool_filetime.o tool_findfile.o
tool_formparse.o tool_getparam.o tool_getpass.o tool_help.o tool_helpers.o tool_hugehelp.o
tool_libinfo.o tool_listhelp.o tool_main.o tool_msgs.o tool_operate.o tool_operhlp.o
tool_panykey.o tool_paramhlp.o tool_parsecfg.o tool_progress.o tool_strdup.o tool_setopt.o
tool_sleep.o tool_urlglob.o tool_util.o tool_vms.o tool_writeout.o tool_writeout_json.o
tool_xattr.o strtoofft.o nonblock.o warnless.o curl_ctype.o curl_multibyte.o version_win32.o
dynbuf.o -L../lib -lcurl -lwldap32 -lws2_32
../lib\libcurl.a: error adding symbols: Archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
make[1]: *** [curl.exe] Fehler 1
make[1]: Leaving directory `D:/Dev/API/curl-7.82.0/src'
make: *** [mingw32] Fehler 2我试着运行ranlib lib\libcurl.a,但问题仍然存在,
有人知道这件事吗?
还有一个问题:也可以用mingw64构建它吗?
发布于 2022-09-21 05:08:53
确保MinGW32 32的bin目录位于搜索路径中,例如:
set PATH=c:\mingw32\bin;%PATH%
然后在根dir中运行mingw32-make mingw32。还有其他可用于构建具有更多功能的libcurl的目标,请使用:
使用Zlib支持构建mingw32-make mingw32-zlib;
在启用SSL和Zlib的情况下构建mingw32-make mingw32-ssl-zlib;
mingw32-make mingw32-ssh2-ssl-zlib用SSH2、SSL、Zlib构建;
mingw32-make mingw32-ssh2-ssl-sspi-zlib要用SSH2、SSL、Zlib和SSPI支持构建。
如果链接库或查找头文件有任何问题,请确保验证提供的Makefile.m32文件是否使用正确的路径,并根据需要进行调整。还可以使用环境变量覆盖这些路径,例如:
set ZLIB_PATH=c:\zlib-1.2.8
set OPENSSL_PATH=c:\openssl-1.0.2c
set LIBSSH2_PATH=c:\libssh2-1.6.0还可以使用OpenLDAP以外的其他LDAP SDK进行构建;目前可以使用本机Win32 OpenLDAP或Novell进行构建。如果要使用这些变量,则需要设置这些vars:
set LDAP_SDK=c:\openldap
set USE_LDAP_OPENLDAP=1或者用于使用Novell:
set USE_LDAP_NOVELL=1如果要启用LDAPS支持,请设置LDAPS=1。
https://stackoverflow.com/questions/71798020
复制相似问题