Boost logo

Boost Users :

From: Merrill Cornish (merrill.cornish_at_[hidden])
Date: 2005-12-11 20:25:31


I am running Boost 1.33.0 and compiling wiht MinGW. When I compile
the following source file

=========================
#include "boost/shared_ptr.hpp"
#include "boost/test/test_tools.hpp"
#include "boost/date_time/posix_time/posix_time_types.hpp"

class foo {
public:
    foo() {}
    ~foo() {}
           boost::posix_time::ptime mExecutionStart;
};

class foo_test {
    foo_test();
    ~foo_test();
    void run();
};

void foo_test::run() {
    boost::shared_ptr<foo> testObj(new foo());
        BOOST_CHECK_EQUAL(testObj->mExecutionStart,
                                          testObj->mExecutionStart);
};
=================================

I get the (lengthy) compiler error output below. As you can see,
something seems to be trying to log something to an output
stream.

The test compile just fine as long as the BOOST_CHECK_EQUAL()
doesn't reference a boost::posix_time::ptime variables.

Any ideas?

Merrill Cornish

=================================

E:/Dev-Cpp/Workflow/boost/include/boost/test/test_tools.hpp: In member function `void boost::test_tools::tt_detail::print_log_value<T>::operator()(std::ostream&, const T&) [with T = boost::posix_time::ptime]':
E:/Dev-Cpp/Workflow/boost/include/boost/test/test_tools.hpp:372: instantiated from `std::ostream& boost::test_tools::tt_detail::operator<<(std::ostream&, const boost::test_tools::tt_detail::print_helper_t<T>&) [with T = boost::posix_time::ptime]'
E:/Dev-Cpp/Workflow/boost/include/boost/test/utils/wrap_stringstream.hpp:66: instantiated from `boost::basic_wrap_stringstream<CharT>& boost::operator<<(boost::basic_wrap_stringstream<CharT>&, const T&) [with CharT = char, T = boost::test_tools::tt_detail::print_helper_t<boost::posix_time::ptime>]'
E:/Dev-Cpp/Workflow/boost/include/boost/test/test_tools.hpp:427: instantiated from `void boost::test_tools::tt_detail::check_frwd(Pred, boost::wrap_stringstream&, boost::test_tools::const_string, size_t, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, const Arg0&, const char*, const Arg1&, const char*) [with Pred = boost::test_tools::tt_detail::equal_impl_frwd, Arg0 = boost::posix_time::ptime, Arg1 = boost::posix_time::ptime]'
E:/Dev-Cpp/Workflow/test/src/TimeDemo.cc:19: instantiated from here
E:/Dev-Cpp/Workflow/boost/include/boost/test/test_tools.hpp:274: error: no match for 'operator<<' in 'ostr << t'
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:63: note: candidates are: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>&(*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:74: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ios<_CharT, _Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:86: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base&(*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:121: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:155: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:98: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:178: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:189: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:193: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:204: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:179: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:214: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:238: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:219: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:261: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:284: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:307: note: std::basic_ostream<E, T>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_streambuf<_CharT, _Traits>*) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:504: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*) [with _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:499: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*) [with _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:612: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:567: note: std::basic_ostream<E, T>& std::operator<<(std::basic_ostream<E, T>&, const char*) [with _CharT = char, _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:465: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char) [with _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:460: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char) [with _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream.tcc:505: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char) [with _Traits = std::char_traits<char>]
E:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:449: note: std::basic_ostream<E, T>& std::operator<<(std::basic_ostream<E, T>&, char) [with _CharT = char, _Traits = std::char_traits<char>]
make: *** [test/obj/TimeDemo.o] Error 1


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net