Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2001-11-23 04:53:21


I downloaded the latest test framework and set it up. I noticed a couple of
problems, and I can't get past the last one.

1. The header <boost/test/test_tools.hpp> is not standalone, because it uses
size_t at global scope. I had to put the following two lines:

#include <cstdlib>
using std::size_t;

before:

#include <boost/test/test_tools.hpp>

2. I tried to compile the following simple program:

*********************************************
#include <cstdlib>
using std::size_t;
#include <boost/test/test_tools.hpp>

#include <iostream>
using namespace std;

int test_main(int, char**)
{
    return 0;
}

#include <libs/test/src/test_tools.cpp>
#include <boost/test/cpp_main.cpp>
#include <boost/test/test_main.cpp>
#include <libs/test/src/unit_test_log.cpp>

*********************************************

As you see, I didn't bother to build libraries or anything; I just included
the cpp files.

MWCW 7.0 yielded the error messages attached below. Could anyone please
enlighten me on what's going on? It's 2 am...

Cheers,

Andrei

*********************************************
Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 78 { detail::report_exception( out, "",
ex ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 80 { detail::report_exception( out, "",
ex.c_str() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 84 { detail::report_exception( out,
"std::bad_alloc:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 88 { detail::report_exception( out,
"std::bad_cast:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 90 { detail::report_exception( out,
"std::bad_typeid:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 99 { detail::report_exception( out,
"std::bad_exception:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 101 { detail::report_exception( out,
"std::domain_error:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 103 { detail::report_exception( out,
"std::invalid_argument:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 105 { detail::report_exception( out,
"std::length_error:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 107 { detail::report_exception( out,
"std::out_of_range:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 109 { detail::report_exception( out,
"std::range_error:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 111 { detail::report_exception( out,
"std::overflow_error:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 113 { detail::report_exception( out,
"std::underflow_error:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 115 { detail::report_exception( out,
"std::logic_error:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 117 { detail::report_exception( out,
"std::runtime_error:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 119 { detail::report_exception( out,
"std::exception:", ex.what() ); }

Error : ambiguous access to name found 'boost::detail' and
'boost::unit_test_framework::detail'
 (instantiating:
'boost::catch_exceptions<boost::test::cpp_main_caller>(boost::test::cpp_main
_caller, std::basic_ostream<char, std::char_traits<char>> &,
std::basic_ostream<char, std::char_traits<char>> &)')
catch_exceptions.hpp line 122 { detail::report_exception( out,
"unknown exception", "" ); }
*********************************************


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk