2

I'm trying to compile a simple example in Turtle (with boost unit test framework) and am getting compilation errors from within Turtle.

I'm assuming that Turtle doesn't really have errors and it's something that I'm doing wrong or have incompatible.

Any help would be appreciated.


The example:

#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK

#include <boost/test/unit_test.hpp>
#include <turtle/mock.hpp>

BOOST_AUTO_TEST_CASE(trutletest){
     BOOST_CHECK(1 == 4);
}

** I've distilled it so it doesn't even uses any Turtle features, just including it causes errors.

The errors I get:

In file included from ../turtle/include/turtle/detail/../matcher.hpp:14,
                 from ../turtle/include/turtle/detail/function.hpp:16,
                 from ../turtle/include/turtle/detail/functor.hpp:12,
                 from ../turtle/include/turtle/reset.hpp:14,
                 from ../turtle/include/turtle/mock.hpp:14,
                 from test.cpp:5:
../turtle/include/turtle/detail/../detail/is_functor.hpp:22: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from ../turtle/include/turtle/detail/function.hpp:16,
                 from ../turtle/include/turtle/detail/functor.hpp:12,
                 from ../turtle/include/turtle/reset.hpp:14,
                 from ../turtle/include/turtle/mock.hpp:14,
                 from test.cpp:5:
../turtle/include/turtle/detail/../matcher.hpp:87: error: ‘is_functor’ is not a member of ‘mock::detail’
../turtle/include/turtle/detail/../matcher.hpp:87: error: ‘is_functor’ is not a member of ‘mock::detail’
../turtle/include/turtle/detail/../matcher.hpp:87: error: template argument 1 is invalid
../turtle/include/turtle/detail/../matcher.hpp:88: error: template argument 3 is invalid
../turtle/include/turtle/detail/../matcher.hpp:89: error: expected unqualified-id before ‘>’ token

The compilation line: g++ test.cpp -o test -I ../turtle/include/ -lboost_unit_test_framework

I'm using: g++ (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) Turtle 1.2.4

Eran
  • 2,324
  • 3
  • 22
  • 27
  • have you tried doing this (from turtle intro) rather than your macros and includes? `#define BOOST_AUTO_TEST_MAIN #include #include ` – Artem Tokmakov Oct 13 '13 at 05:43
  • @biocomp, it doesn't change anything, thanks for trying. – Eran Oct 13 '13 at 06:26
  • 1
    It works fine with g++ 4.8.1, turtle 1.2.4 and boost 1.54.0. Which version of boost are you using? – llonesmiz Oct 13 '13 at 07:55
  • @cv_and_he, I was indeed using an older version of boost (1.4.1) and upgrading fixed the problem, thank you very much. (if you'd like to add this as an answer and not just a comment, I'll accept it). :) – Eran Oct 13 '13 at 09:25

1 Answers1

1

As cv_and_he commented, the problem was using an old boost version.
Updating to the latest boost (1.54.0) fixed the problem.

Eran
  • 2,324
  • 3
  • 22
  • 27