首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cpp-netlib安装visual studio 2013

cpp-netlib安装visual studio 2013
EN

Stack Overflow用户
提问于 2014-10-08 12:06:17
回答 1查看 1.9K关注 0票数 0

我打开这个主题的原因是因为关于设置cpp-netlib的信息相当于tricky.The文档,我过去经常遵循的步骤有点混乱,我不得不提到我是这个开源库的初学者,在询问我做错了什么之前,这里是我做错了什么:

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

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

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

4.在我创建了这个解决方案之后,我看到了更多的examples.The,我感兴趣的是hello_wolrd_server,用来测试一切是否正常。

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

代码语言:javascript
复制
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.I的谈话找不到主题。

提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2015-03-25 01:44:02

如果你遵循CMake的指导,你应该能够为cpp-netlib构建一个Visual Studio项目/解决方案:

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

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

代码语言:javascript
复制
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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26249047

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档