Job 9084

Owner
Andrei Mihai Popa
Problem
Peculiar Times
Source
1.35KB
Result
Compile error (Non-zero exit status: 1)

Compiler output

prog.cpp:7:13: error: 'std::string time' redeclared as different kind of symbol
In file included from /usr/include/pthread.h:26:0,
                 from /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h:41,
                 from /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h:150,
                 from /usr/include/c++/4.7/ext/atomicity.h:34,
                 from /usr/include/c++/4.7/bits/ios_base.h:41,
                 from /usr/include/c++/4.7/ios:43,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from prog.cpp:1:
/usr/include/time.h:186:15: error: previous declaration of 'time_t time(time_t*)'
prog.cpp: In function 'int main()':
prog.cpp:17:15: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&'
In file included from /usr/include/c++/4.7/iostream:41:0,
                 from prog.cpp:1:
/usr/include/c++/4.7/istream:866:5: error:   initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = long int(long int*)throw ()]'
prog.cpp:20:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
prog.cpp:20:18: error: cast from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' loses precision [-fpermissive]
prog.cpp:23:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
prog.cpp:23:18: error: cast from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' loses precision [-fpermissive]
prog.cpp:26:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
prog.cpp:26:18: error: cast from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' loses precision [-fpermissive]
prog.cpp:29:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
prog.cpp:29:18: error: cast from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' loses precision [-fpermissive]

Questions?

Sponsors Gold