Having boost problems on Linux during build

Dec 2, 2014 at 2:36 PM
Edited Dec 2, 2014 at 2:42 PM
Hi,
Firstly thanks for the library, used it once before on windows and thought it was very useful.

I'm now developing an application on Linux and trying to build Casablanca for the first time.
I'm getting (many) errors during the build mostly relating to boost libraries.

I've been following the tutorial:
https://casablanca.codeplex.com/wikipage?title=Setup%20and%20Build%20on%20Linux

Small thing but not main problem:
When I do:
git clone https://git01.codeplex.com/casablanca
I get a 403 or 404 can't remember but that's not my current problem.

Main problem:
[root@web-fpga build.release]# make
[  0%] Building CXX object src/CMakeFiles/cpprest.dir/streams/linux/fileio_linux.cpp.o
In file included from /root/dev/boost/boost_1_57_0/boost/date_time/posix_time/posix_time_types.hpp:16:0,
                 from /root/dev/boost/boost_1_57_0/boost/thread/thread_time.hpp:11,
                 from /root/dev/boost/boost_1_57_0/boost/thread/lock_types.hpp:18,
                 from /root/dev/boost/boost_1_57_0/boost/thread/pthread/mutex.hpp:15,
                 from /root/dev/boost/boost_1_57_0/boost/thread/mutex.hpp:16,
                 from /root/dev/casablanca/casablanca/Release/src/pch/stdafx.h:79,
                 from /root/dev/casablanca/casablanca/Release/src/streams/linux/fileio_linux.cpp:32:
/root/dev/boost/boost_1_57_0/boost/date_time/posix_time/posix_time_duration.hpp: In constructor ‘boost::posix_time::hours::hours(long int)’:
/root/dev/boost/boost_1_57_0/boost/date_time/posix_time/posix_time_duration.hpp:24:26: error: conversion to ‘boost::posix_time::time_duration::hour_type {aka int}’ from ‘long int’ may alter its value [-Werror=conversion]
       time_duration(h,0,0)
                          ^
/root/dev/boost/boost_1_57_0/boost/date_time/posix_time/posix_time_duration.hpp: In constructor ‘boost::posix_time::minutes::minutes(long int)’:
.... and so on
The errors are mainly conversion errors or "x is defined but not used"

Should I turn off warnings being treated as errors? and if so how?
Is it my env config that's not right?

It's almost certainly due to something I've not setup correctly but I can't work out what at the moment.

other info:

g++ -v
gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC)
path:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/dev/boost/boost_1_57_0:/root/dev/boost/boost_1_57_0/boost:/usr/lib64/
Any help would be greatly appreciated!

Thanks
Dec 2, 2014 at 6:24 PM
Hi,

When I do builds on Linux I get those warnings as well. Those warnings are from the actual Boost release code, not Casablanca code. I ended up ignoring them, I use Boost Date/Time all through my application code with conversions all over the place and there's no problems.

Damien
Dec 3, 2014 at 9:03 AM
Thanks for the reply.
Do you know if there is a way I can turn off those warnings which seem to be terminating the build process?
Dec 3, 2014 at 11:24 AM
Edited Dec 3, 2014 at 11:30 AM
I think I've made progress with this now.

With the help of a colleague I have switched to using boost 1.53 instead of boost 1.57.

It looks like boost 1.57 throws warnings which get treated as errors and halt the build, whereas 1.53 does not (so far anyway, at 47% building at the moment)

I also reinstalled boost with yum (to give me 1.53) instead of manually downloading the headers (which gave me 1.57)


EDIT (if you want to use boost 1.57):
I imagine to get around the problem AND still use boost 1.57 you could change the file here:

.../casablanca/Release/src/CMakeLists.txt:76:
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} -Werror -pedantic")

and remove -Werror to make the warnings come up as warnings ad not errors.
Marked as answer by a22c on 12/3/2014 at 3:26 AM
Dec 3, 2014 at 6:45 PM
Yes we haven't updated to using Boost 1.57 with the C++ Rest SDK, we probably will at some point but it isn't high on the priority list right now. I would ignore this warnings from as suggested for now.

Steve
Jun 13, 2015 at 4:36 AM
I'm using Boost-1.58.0, and g++-4.8.2 (Ubuntu 14.04), and having the same issue.

The solution is to remove "-Werror" (treat warning as error) in Release/src/CMakelist.txt:53 into:
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} -pedantic")

Just posting this to let anyone who stumbles on the same issue knows
Aug 6, 2015 at 11:08 AM
Edited Aug 6, 2015 at 11:20 AM
I have the same problem with Boost 1.54 and g++ 4.9.1 on RHEL 6.

However, I cannot find the line CMakelists.txt that you refer to ? I am using SDK version 2.6.

This is a showstopper for me so any advice appreciated !

UPDATE: Sorry, was looking at the wrong file.