简体   繁体   English

C ++:如何在使用libcurl的Windows中运行可执行文件?

[英]C++: How do you run an executable in windows that uses libcurl?

I wrote a utility to grab information off the web using libcurl and written and compiled using Cygwin on a Windows 7 machine. 我编写了一个实用程序,使用libcurl从网上获取信息,并在Windows 7计算机上使用Cygwin编写和编译了该实用程序。 I'd like to be able to run the executable in the windows environment, but when I do I get the error "The program can't start because cygcurl-4.dll is missing from your computer." 我希望能够在Windows环境中运行该可执行文件,但是当我收到错误消息时,该程序无法启动,因为您的计算机缺少cygcurl-4.dll。 I'm not sure how to resolve this, because even if I install libcurl for windows it seems like it's looking specifically for the Cygwin version. 我不确定如何解决此问题,因为即使我为Windows安装了libcurl,它似乎仍在专门针对Cygwin版本。 Ideally I'd like to figure out how to make the program self contained so it can function without people having to install any libraries themselves. 理想情况下,我想弄清楚如何使程序自成一体,这样程序就可以运行而无需人们自己安装任何库。

"The program can't start because cygcurl-4.dll is missing from your computer." “该程序无法启动,因为您的计算机缺少cygcurl-4.dll。”
You only need to distribute cygcurl-4.dll with your executable to solve this (put the dll into the same folder). 您只需要分发cygcurl-4.dll及其可执行文件即可解决此问题(将dll放入同一文件夹中)。

It should be located in the binaries folder of Cygwin. 它应该位于Cygwin的binaries文件夹中。

In order to make your program self-contained, you should try to compile libcurl on Windows as a static library (a .lib file) without cygwin. 为了使您的程序自成一体,您应该尝试在Windows上将libcurl编译为没有cygwin的静态库(.lib文件)。 Some people say that it is doable . 有人说这是可行的 If you're unlucky, maybe you should try some other similar library . 如果您不走运,也许您应该尝试其他类似的库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM