最新主分支编译出错
Opened this issue · 0 comments
heheda123123 commented
ubuntu 23.04
git clone https://github.com/cpp-main/cpp-tbox --depth 1
cat@zoo:~/temp/cpp-tbox$ cmake -B build -DCMAKE_ENABLE_TEST=OFF -DTBOX_ENABLE_DBUS=OFF
*
* cpp-tbox v1.10.11 (Release)
* Copyright (c) 2020-2025 Hevake,Lucas
*
-- base module enabled
-- util module enabled
-- event module enabled
-- eventx module enabled
-- log module enabled
-- network module enabled
-- terminal module enabled
-- trace module enabled
-- main module enabled
-- coroutine module enabled
-- http module enabled
-- mqtt module enabled
-- flow module enabled
-- alarm module enabled
-- crypto module enabled
-- jsonrpc module enabled
-- nlohmann/json installation enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cat/temp/cpp-tbox/build
cat@zoo:~/temp/cpp-tbox$ cmake --build build
[ 1%] Building CXX object modules/base/CMakeFiles/tbox_base.dir/version.cpp.o
[ 1%] Building CXX object modules/base/CMakeFiles/tbox_base.dir/log_imp.cpp.o
[ 2%] Building CXX object modules/base/CMakeFiles/tbox_base.dir/log_output.cpp.o
[ 3%] Building CXX object modules/base/CMakeFiles/tbox_base.dir/backtrace.cpp.o
[ 3%] Building CXX object modules/base/CMakeFiles/tbox_base.dir/catch_throw.cpp.o
[ 4%] Building CXX object modules/base/CMakeFiles/tbox_base.dir/recorder.cpp.o
[ 5%] Linking CXX static library libtbox_base.a
[ 5%] Built target tbox_base
[ 6%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/pid_file.cpp.o
[ 6%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/string.cpp.o
[ 7%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/fs.cpp.o
[ 8%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/argument_parser.cpp.o
[ 9%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/split_cmdline.cpp.o
[ 9%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/serializer.cpp.o
[ 10%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/async_pipe.cpp.o
[ 11%] Building CXX object modules/util/CMakeFiles/tbox_util.dir/timestamp.cpp.o
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp: In function ‘std::string tbox::util::GetUtcTimeString(uint32_t)’:
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:56:15: error: aggregate ‘tm tm’ has incomplete type and cannot be defined
56 | struct tm tm;
| ^~
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:57:5: error: ‘gmtime_r’ was not declared in this scope; did you mean ‘time_t’?
57 | gmtime_r(&ts_sec, &tm);
| ^~~~~~~~
| time_t
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:60:5: error: ‘strftime’ was not declared in this scope
60 | strftime(timestamp_str, sizeof(timestamp_str), "%F %H:%M:%S", &tm);
| ^~~~~~~~
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:22:1: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
21 | #include <sys/time.h>
+++ |+#include <ctime>
22 |
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp: In function ‘std::string tbox::util::GetLocalTimeString(uint32_t)’:
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:68:15: error: aggregate ‘tm tm’ has incomplete type and cannot be defined
68 | struct tm tm;
| ^~
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:69:5: error: ‘localtime_r’ was not declared in this scope; did you mean ‘locale_t’?
69 | localtime_r(&ts_sec, &tm);
| ^~~~~~~~~~~
| locale_t
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:72:5: error: ‘strftime’ was not declared in this scope
72 | strftime(timestamp_str, sizeof(timestamp_str), "%F %H:%M:%S", &tm);
| ^~~~~~~~
/home/cat/temp/cpp-tbox/modules/util/timestamp.cpp:72:5: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
gmake[2]: *** [modules/util/CMakeFiles/tbox_util.dir/build.make:174: modules/util/CMakeFiles/tbox_util.dir/timestamp.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:412: modules/util/CMakeFiles/tbox_util.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
cat@zoo:~/temp/cpp-tbox$ make 3rd-party modules RELEASE=1
make -C 3rd-party
make[1]: Entering directory '/home/cat/temp/cpp-tbox/3rd-party'
make[2]: Entering directory '/home/cat/temp/cpp-tbox/3rd-party/nlohmann'
make[2]: Leaving directory '/home/cat/temp/cpp-tbox/3rd-party/nlohmann'
make[1]: Leaving directory '/home/cat/temp/cpp-tbox/3rd-party'
make -C modules
make[1]: Entering directory '/home/cat/temp/cpp-tbox/modules'
make[2]: Entering directory '/home/cat/temp/cpp-tbox/modules/base'
touch version.cpp
\033[32mCXX version.cpp\033[0m
\033[32mCXX log_imp.cpp\033[0m
\033[32mCXX log_output.cpp\033[0m
\033[32mCXX backtrace.cpp\033[0m
\033[32mCXX catch_throw.cpp\033[0m
\033[32mCXX recorder.cpp\033[0m
\033[35mBUILD libtbox_base.a \033[0m
make[2]: Leaving directory '/home/cat/temp/cpp-tbox/modules/base'
make[2]: Entering directory '/home/cat/temp/cpp-tbox/modules/util'
\033[32mCXX pid_file.cpp\033[0m
\033[32mCXX string.cpp\033[0m
\033[32mCXX fs.cpp\033[0m
\033[32mCXX argument_parser.cpp\033[0m
\033[32mCXX split_cmdline.cpp\033[0m
\033[32mCXX serializer.cpp\033[0m
\033[32mCXX async_pipe.cpp\033[0m
\033[32mCXX timestamp.cpp\033[0m
timestamp.cpp: In function ‘std::string tbox::util::GetUtcTimeString(uint32_t)’:
timestamp.cpp:56:15: error: aggregate ‘tm tm’ has incomplete type and cannot be defined
56 | struct tm tm;
| ^~
timestamp.cpp:57:5: error: ‘gmtime_r’ was not declared in this scope; did you mean ‘time_t’?
57 | gmtime_r(&ts_sec, &tm);
| ^~~~~~~~
| time_t
timestamp.cpp:60:5: error: ‘strftime’ was not declared in this scope
60 | strftime(timestamp_str, sizeof(timestamp_str), "%F %H:%M:%S", &tm);
| ^~~~~~~~
timestamp.cpp:22:1: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
21 | #include <sys/time.h>
+++ |+#include <ctime>
22 |
timestamp.cpp: In function ‘std::string tbox::util::GetLocalTimeString(uint32_t)’:
timestamp.cpp:68:15: error: aggregate ‘tm tm’ has incomplete type and cannot be defined
68 | struct tm tm;
| ^~
timestamp.cpp:69:5: error: ‘localtime_r’ was not declared in this scope; did you mean ‘locale_t’?
69 | localtime_r(&ts_sec, &tm);
| ^~~~~~~~~~~
| locale_t
timestamp.cpp:72:5: error: ‘strftime’ was not declared in this scope
72 | strftime(timestamp_str, sizeof(timestamp_str), "%F %H:%M:%S", &tm);
| ^~~~~~~~
timestamp.cpp:72:5: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
make[2]: *** [/home/cat/temp/cpp-tbox/mk/lib_tbox_common.mk:85: /home/cat/temp/cpp-tbox/.build/util/timestamp.o] Error 1
make[2]: Leaving directory '/home/cat/temp/cpp-tbox/modules/util'
make[1]: *** [Makefile:22: all] Error 2
make[1]: Leaving directory '/home/cat/temp/cpp-tbox/modules'
make: *** [Makefile:69: modules] Error 2
cat@zoo:~/temp/cpp-tbox$