如何在 Windows 中安装 cURLpp?
这里完全是新手,正如您很可能从我之前的帖子中猜到的那样。我似乎找不到任何相关内容,而且我以前从未安装过库。我之前的问题的答案是告诉我安装和使用 libcurl,而 cURLpp 是 C++ 的包装器,所以我很自然地认为 cURLpp 是正确的选择。那么,我该如何安装它呢?
Complete newbie here, as you most probably guessed by my previous post. I can't seem to find anything on this, and I have never installed a library before. my previous question was answered with telling me to install and use libcurl, and that cURLpp is a wrapper for C++, so naturally I assumed that cURLpp was the way to go. So, how do I install it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这个问题已经很老了,但我会分享我的经验。
操作系统:MS Windows 10(64位)
我使用MSYS2 MinGW GCC编译器和工具,所以我假设系统中已经安装了mingw-gcc、mingw-cmake、mingw-make和mingw-curl,并且msys2/mingw64/ bin 在你的路径中。
在终端中,请按照以下步骤操作:
步骤 1)
git clone [电子邮件受保护]:jpbarrette/curlpp.git< /代码>
步骤 2)
cd curpp
步骤 3)
mkdir build
步骤 4)
cd build
步骤 5)
cmake -G "MinGW Makefiles" .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
步骤 6)
cmake --build .
之后,在
curlpp/build
中,您将找到文件libcurlpp.a
、libcurlpp.dll。 a
和libcurlpp.dll
。现在您需要将libcurlpp.dll.a
添加到链接器设置中(请记住也添加libcurl.dll.a
,因为它是 libcurlpp 的依赖项)。最后,您可以编译您的程序,它应该可以工作。如果您收到一条消息,指出未找到 libcurlpp.dll,请将
libcurlpp.dll
复制到二进制文件旁边。I know this question is quite old, but I will share what has worked in my experience.
OS: MS Windows 10 (64 bit)
I'm using MSYS2 MinGW GCC compiler and tools, so I assume mingw-gcc, mingw-cmake, mingw-make, and mingw-curl are already installed in the system and msys2/mingw64/bin is in your PATH.
In a terminal, follow these steps:
Step 1)
git clone [email protected]:jpbarrette/curlpp.git
Step 2)
cd curlpp
Step 3)
mkdir build
Step 4)
cd build
Step 5)
cmake -G "MinGW Makefiles" .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
Step 6)
cmake --build .
After this, in your
curlpp/build
you will find the fileslibcurlpp.a
,libcurlpp.dll.a
, andlibcurlpp.dll
. Now you need to addlibcurlpp.dll.a
to your linker settings (remember to addlibcurl.dll.a
too, because it is a dependency of libcurlpp).Finally, you can compile your program, and it should work. If you receive a message saying libcurlpp.dll is not found, copy the
libcurlpp.dll
next to your binary.