问题
When I import etc.c.curl;
DMD tells me
Warning 2: File Not Found curl.lib
Where is this curl.lib?
(I've tried several packages from http://curl.haxx.se/download.html but haven't found curl.lib there. MSVC package libcurl-7.19.3-win32-ssl-msvc.zip
have a curllib.lib
but DMD won't link with it.)
回答1:
You can create curl.lib using implib. Implib is in the Basic Utilities download.
Run it against your curllib.dll in /libcurl-7.19.3-win32-ssl-msvc/lib/Release/ like this:
implib /s curl.lib curllib.dll
Then put curl.lib where dmd can find it and compile. Unfortunately, you'll probably still get an error about a missing libsasl.dll when you run your program. You may be able to use a binary from Shining Light Productions, build it with MSVC from the OpenSSL source, or hunt it down online.
There's still a possibility you'll have trouble with conflicting versions. If you browse the etc.c.curl source, you'll notice it lists its cURL version as 7.21.4, which doesn't match any of the Windows binaries available. If you want something very reliable, you may have to wait for the next D cURL module or build everything yourself.
回答2:
It's not there yet because Curl support in D is a work in progress. etc.c.curl
was added to Phobos with the intention of an object oriented wrapper eventually being added. This wrapper has been through a round of review and is being revised in preparation for another round. curl.lib will probably be included, at least on Windows, when Curl support is fully fleshed out and this wrapper is included.
来源:https://stackoverflow.com/questions/7933845/where-is-curl-lib-for-dmd