Using cpp-netlib in a C++ project under Windows

1,402 views
Skip to first unread message

EF

unread,
Apr 10, 2012, 8:00:29 AM4/10/12
to The C++ Network Library
I want to use the cpp-netlib library in a C++ project of mine running
on Windows. I've strictly followed the instructions under
http://cpp-netlib.github.com/getting_started.html up to the "Getting
CMake" section, which is where I stopped understanding the
instruction. Is CMake indeed non-obligatory? If so, what are the exact
steps required so I can use the library in my projects?

If someone could provide me with instructions here, or refer me to a
detailed guide it'd be great. Google didn't help me that much.

Glyn Matthews

unread,
Apr 10, 2012, 8:14:49 AM4/10/12
to cpp-n...@googlegroups.com
Hi Eddie,

On 10 April 2012 14:00, EF <eddi...@gmail.com> wrote:
I want to use the cpp-netlib library in a C++ project of mine running
on Windows. I've strictly followed the instructions under
http://cpp-netlib.github.com/getting_started.html up to the "Getting
CMake" section, which is where I stopped understanding the
instruction. Is CMake indeed non-obligatory? If so, what are the exact
steps required so I can use the library in my projects?


That appears to be a documentation bug. You do need to use CMake in order to build cpp-netlib (unless you know what you're doing and can integrate the source code into your own project).
 
If someone could provide me with instructions here, or refer me to a
detailed guide it'd be great. Google didn't help me that much.


The rest of the documentation ought to provide enough information about what you need to do to build cpp-netlib using CMake.  What works for me is opening a visual studio command prompt, changing to a build directory and invoking `cmake C:\path\to\cpp-netlib`.  This will generate the project file in the current directory which you can use in the normal way.
HTH,

Glyn



EF

unread,
Apr 10, 2012, 9:55:43 AM4/10/12
to The C++ Network Library
Hey Glyn,

Thank you for your reply.

Two questions:

1. By a build directory you mean any directory of my choice?
2. When trying to build using CMAKE, I've encountered the following
error messages:

"
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/
FindBoost.cmak
e:1199 (message):
Unable to find the requested Boost libraries.

Boost version: 1.49.0

Boost include path: C:/Program Files/BOOST/boost_1_49_0

The following Boost libraries could not be found:

boost_unit_test_framework
boost_system
boost_regex
boost_date_time
boost_thread
boost_filesystem
boost_program_options

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR
to the
directory containing Boost libraries or BOOST_ROOT to the location
of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:10 (find_package)


-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder
in the sys
tem variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR)

-- Configuring incomplete, errors occurred!
"

BOOST_ROOT I have set to C:\Program Files\BOOST\boost_1_49_0 which is
the correct path to boost, and
OPENSSL_ROOT_DIR points to which is where I've unzipped the OpenSSL
zipped directory I've downloaded.
On the OpenSSL issue I assume I need to do more than that, but I don't
know exactly what.

Help? :)

On Apr 10, 3:14 pm, Glyn Matthews <glyn.matth...@gmail.com> wrote:
> Hi Eddie,
>
> On 10 April 2012 14:00, EF <eddie...@gmail.com> wrote:
>
> > I want to use the cpp-netlib library in a C++ project of mine running
> > on Windows. I've strictly followed the instructions under
> >http://cpp-netlib.github.com/getting_started.htmlup to the "Getting

idleman

unread,
Apr 10, 2012, 11:08:18 AM4/10/12
to cpp-n...@googlegroups.com
If you are using are using Visual Studio 2010 you way try:

cmake -G "Visual Studio 10" -DBOOST_LIBRARYDIR:string="C:\boost\Win32" ../cpp-netlib.

I the example should directory "C:\boost\Win32" contain every static library (.lib) of your boost installation (in a list, no directories, just a listof .lib files). A note can also be that cmake tries to find boost header files in C:\boost\include and similar paths, so make sure they exists - if you not define the include dir too. To see others options, type cmake --help :-)

Hope it works.
Reply all
Reply to author
Forward
0 new messages