简体   繁体   English

cpp-netlib安装Visual Studio 2013

[英]cpp-netlib install visual studio 2013

The reason that i open this topic is because the information about setting up the cpp-netlib is quite tricky.The documentation that i used to follow the steps is bit confused, i have to mention that i'm a beginner with this open source libraries, and before asking what have i done wrong here is what i did: 我打开此主题的原因是因为有关设置cpp-netlib的信息非常棘手。我用来遵循这些步骤的文档有点混乱,我不得不提一下我是这个开源库的初学者,在问我做错了什么之前,这里是我做了什么:

1.Before setting cpp-netlib v 11.0 i installed boost.I run it their example by adding the headers necessarily, so far everything looks good. 1,在设置cpp-netlib v 11.0之前,我安装了boost。我通过添加必要的标题来运行它们的示例,到目前为止一切都很好。

2.I had setup the path BOOS_ROOT for cpp-netlib 2.我已经为cpp-netlib设置了路径BOOS_ROOT

3.After i unzipped the cpp-netlib file i used cmake to build it.I also noticed that there are more CMakeList files, so i use the first one.It didn't worked... Next i looked in the examples (..\\cpp-netlib-0.11.0-final\\libs\\network\\example) and noticed a second one.This one worked. 3.解压缩cpp-netlib文件后,我使用cmake来构建它。我还注意到还有更多的CMakeList文件,所以我使用了第一个文件。它没有用...接下来我看了示例(。 。\\ cpp-netlib-0.11.0-final \\ libs \\ network \\ example),并注意到第二个。

4.After i created the solution i saw more examples.The one that i'm interested is hello_wolrd_server, to test that everything works fine. 4.创建解决方案后,我看到了更多示例。我感兴趣的示例是hello_wolrd_server,以测试一切正常。

5.I added the headers and build it and i get the following log. 5.我添加了标头并进行了构建,并得到了以下日志。

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 ==========

Before asking what i'm doing it wrong, i want to mention that cpp-netlib talks about 3 libs .I couldn't find theme. 在问我做错了什么之前,我要提到cpp-netlib谈论3个库 。我找不到主题。

Thanks in advance! 提前致谢!

You should be able to build an Visual Studio project/solution for cpp-netlib if you follow the CMake instructions: 如果遵循CMake指示,则应该能够为cpp-netlib构建Visual Studio项目/解决方案:

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

You should be able to generate the solutions using CMake's "Visual Studio" generator. 您应该能够使用CMake的“ Visual Studio”生成器生成解决方案。 This should look something like: 看起来应该像这样:

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

This should produce the solution and project files for Visual Studio. 这将为Visual Studio生成解决方案和项目文件。 You can find a list of CMake generators for the correct version of Visual Studio you're using here: 您可以在此处找到使用的Visual Studio正确版本的CMake生成器列表:

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

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

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