0

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:

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.

2.I had setup the path BOOS_ROOT for cpp-netlib

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.

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.

5.I added the headers and build it and i get the following log.

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.

Thanks in advance!

4
  • Check that include directories are specified properly. Commented Oct 8, 2014 at 4:51
  • I managed to solve the problem.It seemed that boost had no libraries included. Commented Oct 15, 2014 at 11:12
  • you can post a solution then, in case someone bumps into the same thing Commented Oct 15, 2014 at 11:58
  • 1
    I've notice that the solution is just a quick fix for my sample server.What i've done i used the prebuilt binaries for boost.However if i use cpp-netlib in another project it's still not working.The clinet code is here (cpp-netlib.org/0.11.0/index.html#hello-world).I assume that those 3 libs mentioned in the topic are the problem.The reason i'm saying this because i get a LNK 2019 error.I found what i have to do (cpp-netlib.org/0.11.0/index.html#hello-world) and now i need 3 static libraries, the one that are missing.To do this i have to build with cmake, but i got stuck here. Commented Oct 15, 2014 at 18:30

1 Answer 1

1

You should be able to build an Visual Studio project/solution for cpp-netlib if you follow the CMake instructions:

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. 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. You can find a list of CMake generators for the correct version of Visual Studio you're using here:

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.