Fix Ubuntu 12.04 build issues.

This commit is contained in:
Tristan Penman 2014-04-17 21:31:18 +00:00
parent 15884edc8e
commit 11af5466f0
6 changed files with 9 additions and 16 deletions

View File

@ -5,16 +5,17 @@ compiler:
- gcc
before_install:
- sudo apt-get install python-software-properties
- sudo add-apt-repository ppa:boost-latest/ppa
- sudo apt-get update -qq
install:
- sudo apt-get install libboost-dev libboost-regex-dev
- sudo apt-get install libboost1.55-dev libboost-regex1.55-dev
before_script:
- mkdir -p build
script:
- export CXXFLAGS="-std=c++0x"
- pushd build
- cmake ..
- make

View File

@ -5,7 +5,7 @@ set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.55.0 COMPONENTS regex)
find_package(Boost 1.55.0 COMPONENTS regex REQUIRED)
# jsoncpp library
add_library(jsoncpp

View File

@ -1,7 +1,7 @@
#ifndef __VALIJSON_ADAPTERS_BASIC_ADAPTER_HPP
#define __VALIJSON_ADAPTERS_BASIC_ADAPTER_HPP
#include <cstdint>
#include <stdint.h>
#include <sstream>
#include <boost/foreach.hpp>

View File

@ -26,7 +26,7 @@
#ifndef __VALIJSON_ADAPTERS_JSONCPP_ADAPTER_HPP
#define __VALIJSON_ADAPTERS_JSONCPP_ADAPTER_HPP
#include <cstdint>
#include <stdint.h>
#include <string>
#include <boost/bind.hpp>
#include <boost/iterator/iterator_facade.hpp>

View File

@ -16,16 +16,8 @@ namespace utils {
inline bool loadDocument(const std::string &path, boost::property_tree::ptree &document)
{
// Load schema JSON from file
std::string file;
if (!loadFile(path, file)) {
std::cerr << "Failed to load json from file '" << path << "'." << std::endl;
return false;
}
std::istringstream is(file);
try {
boost::property_tree::read_json(is, document);
boost::property_tree::read_json(path, document);
} catch (boost::property_tree::json_parser::json_parser_error &e) {
std::cerr << "Boost Property Tree JSON parser failed to parse the document:" << std::endl;
std::cerr << e.what() << std::endl;

View File

@ -25,7 +25,7 @@ protected:
strictGroup(strictGroup),
looseGroup(looseGroup) { }
const std::string path;
std::string path;
int strictGroup;
int looseGroup;
@ -154,4 +154,4 @@ TEST_F(TestAdapterComparison, RapidJsonVsRapidJson)
testComparison<
valijson::adapters::RapidJsonAdapter,
valijson::adapters::RapidJsonAdapter>();
}
}