/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:10:12: error: no match for 'operator<<' in 'std::cin << a'
foo.cpp:10:12: note: candidates are:
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/string:54:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/locale_classes.h:42,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/ios_base.h:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ios:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:40,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.h:2750:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.h:2750:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<_CharT, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:469:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:469:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<_CharT, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:474:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:474:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<_CharT, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:480:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:480:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<char, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:486:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:486:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<char, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:491:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:491:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<char, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:511:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:511:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<_CharT, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:607:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/ostream.tcc:323:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/ostream.tcc:323:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<_CharT, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:528:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:528:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<char, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:541:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:541:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<char, _Traits>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40:0,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:546:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:546:5: note:   template argument deduction/substitution failed:
foo.cpp:10:12: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'std::basic_ostream<char, _Traits>'

信息

递交者
类型
递交
题目
P1047 最小公倍数
语言
C++
递交时间
2013-04-04 17:44:20
评测时间
2013-04-04 17:44:21
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes