using curl on mingw

本文详细介绍了在使用Cygwin环境下解决curl-7.28.1-devel-mingw32.zip编译时遇到的问题,包括下载源代码、构建样本、遇到的错误及其解决方案,以及最终成功运行chkspeed.exe的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. download curl for mingw:
http://curl.haxx.se/gknw.net/7.28.1/dist-w32/curl-7.28.1-devel-mingw32.zip


2.build the sample in curl-7.28.1-devel-mingw32.zip
Makefile.m32 is not working, so try the following instead:
gcc -I. -I.. -I../include -I"../lib" -I"../lib/include" -g -O2 -fno-strict-aliasing -DCURL_STATICLIB -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H -DHAVE_LIBZ -DHAVE_ZLIB_H -DUSE_LIBIDN -DUSE_WINDOWS_SSPI -c chkspeed.c
gcc -s -o chkspeed.exe chkspeed.o  -L../lib -lcurl -L../lib/win32 -lssh2 -L../lib -lz -L../lib/lib -lidn -lrtmp -lcrypto -lssl -lwldap32 -lws2_32 -lwinmm


3.run chkspeed.exe
At first, I run chkspeed.exe on shell, and it Immediately Crashes on Startup. try gdb chkspeed.exe, and get something like gdb: unknown target exception 0xc0000135 at 0x7c974ed1(http://cygwin.com/ml/cygwin/2007-07/msg00464.html). google it, and get some interesting info:
http://cygwin.com/ml/cygwin/2007-07/msg00541.html
http://www.cygwin.com/ml/cygwin/2004-09/msg01101.html
http://www.cygwin.com/ml/cygwin/2004-10/msg01052.html
but the solution doesn't work at all.


I then happen to double click the exe, and get missing-some-dll warning, and those dlls are in curl-7.28.1-devel-mingw32.zip/bin. So, more the exe into bin, it works!

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "D:\Work\BaiDuPan1\Lib\site-packages\conda\exception_handler.py", line 18, in __call__ return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\Work\BaiDuPan1\Lib\site-packages\conda\cli\main.py", line 61, in main_subshell exit_code = do_call(args, parser) ^^^^^^^^^^^^^^^^^^^^^ File "D:\Work\BaiDuPan1\Lib\site-packages\conda\cli\conda_argparse.py", line 205, in do_call result = getattr(module, func_name)(args, parser) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Work\BaiDuPan1\Lib\site-packages\conda\notices\core.py", line 132, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\Work\BaiDuPan1\Lib\site-packages\conda\cli\main_update.py", line 103, in execute install(args, parser, "update") File "D:\Work\BaiDuPan1\Lib\site-packages\conda\cli\install.py", line 409, in install unlink_link_transaction = solver.solve_for_transaction( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Work\BaiDuPan1\Lib\site-packages\conda\core\solve.py", line 166, in solve_for_transaction context.plugin_manager.invoke_post_solves( File "D:\Work\BaiDuPan1\Lib\site-packages\conda\plugins\manager.py", line 455, in invoke_post_solves for hook in self.get_hook_results("post_solves"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Work\BaiDuPan1\Lib\site-packages\conda\plugins\manager.py", line 236, in get_hook_results plugins = [item for items in hook(**kwargs) for item in items] ^^^^^ File "D:\Work\BaiDuPan1\Lib\site-packages\conda\plugins\post_solves\signature_verification.py", line 10, in condas from ...trust.signature_verification import signature_verification File "D:\Work\BaiDuPan1\Lib\site-packages\conda\trust\signature_verification.py", line 16, in <module> from conda_content_trust.authentication import verify_delegation, verify_root File "D:\Work\BaiDuPan1\Lib\site-packages\conda_content_trust\authentication.py", line 20, in <module> from .common import ( File "D:\Work\BaiDuPan1\Lib\site-packages\conda_content_trust\common.py", line 55, in <module> from cryptography.hazmat.primitives import serialization File "D:\Work\BaiDuPan1\Lib\site-packages\cryptography\hazmat\primitives\serialization\__init__.py", line 25, in > from cryptography.hazmat.primitives.serialization.ssh import ( File "D:\Work\BaiDuPan1\Lib\site-packages\cryptography\hazmat\primitives\serialization\ssh.py", line 27, in <modu> from cryptography.hazmat.primitives.ciphers import ( File "D:\Work\BaiDuPan1\Lib\site-packages\cryptography\hazmat\primitives\ciphers\__init__.py", line 11, in <modul> from cryptography.hazmat.primitives.ciphers.base import ( File "D:\Work\BaiDuPan1\Lib\site-packages\cryptography\hazmat\primitives\ciphers\base.py", line 143, in <module> CipherContext.register(rust_openssl.ciphers.CipherContext) ^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'openssl' has no attribute 'ciphers' `$ D:\Work\BaiDuPan1\Scripts\conda-script.py update openssl cryptography -y` environment variables: CIO_TEST=<not set> CLASSPATH=D:\LINGO64_18\Lingo18.jar CONDA_ALLOW_SOFTLINKS=false CONDA_BAT=D:\Work\BaiDuPan1\condabin\conda.bat CONDA_DEFAULT_ENV=base CONDA_EXE=D:\Work\BaiDuPan1\Scripts\conda.exe CONDA_EXES="D:\Work\BaiDuPan1\Scripts\conda.exe" CONDA_PREFIX=D:\Work\BaiDuPan1 CONDA_PROMPT_MODIFIER=(base) CONDA_PYTHON_EXE=D:\Work\BaiDuPan1\python.exe CONDA_ROOT=D:\Work\BaiDuPan1 CONDA_SHLVL=1 CURL_CA_BUNDLE=<not set> HOMEPATH=\Users\30855 LD_PRELOAD=<not set> PATH=D:\Work\BaiDuPan1;D:\Work\BaiDuPan1\Library\mingw- w64\bin;D:\Work\BaiDuPan1\Library\usr\bin;D:\Work\BaiDuPan1\Library\bi n;D:\Work\BaiDuPan1\Scripts;D:\Work\BaiDuPan1\bin;D:\Work\BaiDuPan1\co ndabin;D:\MPI\Bin;D:\VMware\bin;D:\浣犳兂瑕佺殑\Scripts;C:\;indows;C:\Window s\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\ System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\runtime\win64;D:\bin;D:\LINGO64_18;C:\Program Files\dotnet;D:\Work\Pycharm\Git\cmd;D:\RedPanda- Cpp\MinGW64\bin;D:\Work\Cygwin64\bin;D:\OpenSSL- Win64\bin;C:\Windows\System32;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Work\Pycharm\Git\cmd;D:\Work\Ba iDuPan1;D:\Work\BaiDuPan1\Library\mingw- w64\bin;D:\Work\BaiDuPan1\Library\usr\bin;D:\Work\BaiDuPan1\Library\bi n;D:\Work\BaiDuPan1\Scripts;C:\Users\30855\AppData\Local\Microsoft\Win dowsApps;D:\Work\Pycharm\JetBrains\PyCharm Community Edition 2024.2.1\bin;.;;D:\RedPanda- Cpp\MinGW64\bin;C:\Users\30855\AppData\Local\Programs\Microsoft VS Cod e\bin;D:\Quartus18.1\Quartus18.1\modelsim_ase\win32aloem;C:\Windows\Sy stem32;. PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\Windows PowerShell\v1.0\Modules REQUESTS_CA_BUNDLE=<not set> SSL_CERT_FILE=D:\Work\BaiDuPan1\Library\ssl\cacert.pem active environment : base active env location : D:\Work\BaiDuPan1 shell level : 1 user config file : C:\Users\30855\.condarc populated config files : D:\Work\BaiDuPan1\.condarc C:\Users\30855\.condarc conda version : 24.11.3 conda-build version : 24.9.0 python version : 3.12.7.final.0 solver : libmamba (default) virtual packages : __archspec=1=skylake __conda=24.11.3=0 __cuda=12.0=0 __win=0=0 base environment : D:\Work\BaiDuPan1 (writable) conda av data dir : D:\Work\BaiDuPan1\etc\conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : D:\Work\BaiDuPan1\pkgs C:\Users\30855\.conda\pkgs C:\Users\30855\AppData\Local\conda\conda\pkgs envs directories : D:\Work\BaiDuPan1\envs C:\Users\30855\.conda\envs C:\Users\30855\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/24.11.3 requests/2.32.3 CPython/3.12.7 Windows/11 Windows/10.0.22631 solver/libmamba co8 administrator : False netrc file : None offline mode : False An unexpected error has occurred. Conda has prepared the above report. If you suspect this error is being caused by a malfunctioning plugin, consider using the --no-plugins option to turn off plugins. Example: conda --no-plugins install <package> Alternatively, you can set the CONDA_NO_PLUGINS environment variable on the command line to run the command without plugins enabled. Example: CONDA_NO_PLUGINS=true conda install <package> Upload did not complete.
05-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值