Menu

#7 make: "common.cpp:229:14: error: ‘time’ was not declared in this scope 229 | lt = time(NULL);"

v1.0 (example)
open
nobody
None
5
2024-06-05
2024-06-05
No

~/zod_engine/zod_src $ make
g++ -c -g sdl-config --cflags -D DISABLE_OPENGL -D DISABLE_REGCHECK main.cpp
g++ -c -g sdl-config --cflags -D DISABLE_OPENGL -D DISABLE_REGCHECK common.cpp
common.cpp: In function ‘void COMMON::print_dump(char, int, char)’:
common.cpp:152:24: warning: '0' flag ignored with precision and ‘%x’ gnu_printf format [-Wformat=]
152 | printf("%0.2x ", message[i]);
| ^~~~~~~~
common.cpp: In function ‘void COMMON::printd_reg(char*)’:
common.cpp:229:14: error: ‘time’ was not declared in this scope
229 | lt = time(NULL);
| ^~~~
common.cpp:18:1: note: ‘time’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
17 | #include <dirent.h>
+++ |+#include <ctime>
18 | #include <errno.h>
common.cpp:230:15: error: ‘localtime’ was not declared in this scope
230 | ptr = localtime(&lt);
| ^~~~~~~~~
common.cpp:230:15: note: ‘localtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
common.cpp:234:25: error: ‘asctime’ was not declared in this scope
234 | strcpy(timebuf, asctime(ptr));
| ^~~~~~~
common.cpp:234:25: note: ‘asctime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
make: *** [makefile:37: common.o] Error 1</ctime></ctime></ctime></ctime></errno.h></ctime></dirent.h></ctime></ctime>

Discussion


Log in to post a comment.