gpt4 book ai didi

c++ - cpp-netlib 安装 visual studio 2013

转载 作者:行者123 更新时间:2023-11-28 06:39:17 25 4
gpt4 key购买 nike

我打开这个主题的原因是因为关于设置 cpp-netlib 的信息非常棘手。我用来遵循这些步骤的文档有点困惑,我不得不说我是一个初学者开源库,在问我做错了什么之前,我做了什么:

1.在设置 cpp-netlib v 11.0 之前,我安装了 boost。我通过添加必要的 header 来运行他们的示例,到目前为止一切看起来都很好。

2.我已经为cpp-netlib设置了路径BOOS_ROOT

3.解压cpp-netlib文件后,我使用cmake构建它。我还注意到有更多的CMakeList文件,所以我使用第一个。它没有用...接下来我查看了示例 (..\cpp-netlib-0.11.0-final\libs\network\example) 并注意到第二个。这个有效。

4.创建解决方案后,我看到了更多示例。我感兴趣的示例是 hello_wolrd_server,用于测试一切是否正常。

5.我添加了 header 并构建了它,我得到了以下日志。

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
2>------ Build started: Project: atom_reader, Configuration: Debug x64 ------
3>------ Build started: Project: hello_world_async_server_with_work_queue, Configuration: Debug x64 ------
4>------ Build started: Project: hello_world_client, Configuration: Debug x64 ------
5>------ Build started: Project: hello_world_server, Configuration: Debug x64 ------
6>------ Build started: Project: http_client, Configuration: Debug x64 ------
7>------ Build started: Project: rss_reader, Configuration: Debug x64 ------
8>------ Build started: Project: simple_wget, Configuration: Debug x64 ------
9>------ Build started: Project: twitter_search, Configuration: Debug x64 ------
2> atom.cpp
2>d:\data\genericsearchengine\cpp-netlib-0.11.0-final\libs\network\example\atom\atom.hpp(12): fatal error C1083: Cannot open include file: 'boost/network/protocol/http.hpp': No such file or directory
2> main.cpp
2>d:\data\genericsearchengine\cpp-netlib-0.11.0-final\libs\network\example\atom\atom.hpp(12): fatal error C1083: Cannot open include file: 'boost/network/protocol/http.hpp': No such file or directory
2> Generating Code...
8> simple_wget.cpp
8>D:\Data\GenericSearchEngine\cpp-netlib-0.11.0-final\libs\network\example\simple_wget.cpp(17): fatal error C1083: Cannot open include file: 'boost/network/protocol/http/client.hpp': No such file or directory
3> hello_world_async_server_with_work_queue.cpp
3>D:\Data\GenericSearchEngine\cpp-netlib-0.11.0-final\libs\network\example\http\hello_world_async_server_with_work_queue.cpp(9): fatal error C1083: Cannot open include file: 'boost/network/include/http/server.hpp': No such file or directory
9> search.cpp
9>D:\Data\GenericSearchEngine\cpp-netlib-0.11.0-final\libs\network\example\twitter\search.cpp(7): fatal error C1083: Cannot open include file: 'boost/network/protocol/http/client.hpp': No such file or directory
6> http_client.cpp
6>D:\Data\GenericSearchEngine\cpp-netlib-0.11.0-final\libs\network\example\http_client.cpp(3): fatal error C1083: Cannot open include file: 'boost/network/protocol/http/server.hpp': No such file or directory
4> hello_world_client.cpp
7> rss.cpp
5>LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc120-mt-gd-1_56.lib'
4>D:\Data\GenericSearchEngine\cpp-netlib-0.11.0-final\libs\network\example\http\hello_world_client.cpp(14): fatal error C1083: Cannot open include file: 'boost/network/protocol/http/client.hpp': No such file or directory
7>d:\data\genericsearchengine\cpp-netlib-0.11.0-final\libs\network\example\rss\rss.hpp(12): fatal error C1083: Cannot open include file: 'boost/network/protocol/http.hpp': No such file or directory
7> main.cpp
7>d:\data\genericsearchengine\cpp-netlib-0.11.0-final\libs\network\example\rss\rss.hpp(12): fatal error C1083: Cannot open include file: 'boost/network/protocol/http.hpp': No such file or directory
7> Generating Code...
10>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug x64 ------
10>Project not selected to build for this solution configuration
========== Build: 1 succeeded, 8 failed, 0 up-to-date, 1 skipped ==========

在问我做错了什么之前,我想提一下 cpp-netlib 谈论 3 libs .我找不到主题。

提前致谢!

最佳答案

如果您遵循 CMake 说明,您应该能够为 cpp-netlib 构建 Visual Studio 项目/解决方案:

http://cpp-netlib.org/0.11.1/getting_started.html#building-on-windows

您应该能够使用 CMake 的“Visual Studio”生成器生成解决方案。这应该看起来像:

cd ~
mkdir cpp-netlib-build
cd cpp-netlib-build
cmake ../cpp-netlib-0.11.1 -G "Visual Studio 10 Win64"

这应该为 Visual Studio 生成解决方案和项目文件。您可以在此处找到适用于您正在使用的正确 Visual Studio 版本的 CMake 生成器列表:

http://www.cmake.org/cmake/help/v3.1/manual/cmake-generators.7.html

关于c++ - cpp-netlib 安装 visual studio 2013,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26249047/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com