chenshuo/muduo

本地build失败

Opened this issue · 6 comments

Scanning dependencies of target muduo_base
[ 0%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/AsyncLogging.cc.o
[ 0%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/Condition.cc.o
[ 1%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/CountDownLatch.cc.o
[ 1%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/CurrentThread.cc.o
[ 1%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/Date.cc.o
[ 1%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/Exception.cc.o
[ 2%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/FileUtil.cc.o
[ 2%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/LogFile.cc.o
[ 2%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/Logging.cc.o
[ 2%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/LogStream.cc.o
[ 3%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/ProcessInfo.cc.o
[ 3%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/Timestamp.cc.o
[ 3%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/Thread.cc.o
[ 3%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/ThreadPool.cc.o
[ 4%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/TimeZone.cc.o
distcc[55570] ERROR: compile (null) on localhost failed
/home/muduo/muduo/base/TimeZone.cc: 在函数‘bool muduo::detail::readDataBlock(muduo::detail::File&, muduo::TimeZone::Data*, bool)’中:
/home/muduo/muduo/base/TimeZone.cc:171:36: 错误:‘int’转换自‘long unsigned int’时可能改变值 [-Werror=conversion]
const int time_size = v1 ? sizeof(int32_t) : sizeof(int64_t);
^
/home/muduo/muduo/base/TimeZone.cc:171:54: 错误:‘int’转换自‘long unsigned int’时可能改变值 [-Werror=conversion]
const int time_size = v1 ? sizeof(int32_t) : sizeof(int64_t);
^
cc1plus: all warnings being treated as errors
make[2]: *** [muduo/base/CMakeFiles/muduo_base.dir/TimeZone.cc.o] 错误 1
make[1]: *** [muduo/base/CMakeFiles/muduo_base.dir/all] 错误 2
make: *** [all] 错误 2
上面是错误信息

环境:
CentOS Linux release 7.9.2009 (Core) x86_64

Boost版本:
boost-devel.x86_64 0:1.53.0-28.el7

cmake版本:
cmake version 3.7.2

gcc版本:
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

修改muduo/base/CMakeLists.txt, 添加-Wno-conversion与-Wno-missing-field-initializers后编译成功

修改muduo/base/CMakeLists.txt, 添加-Wno-conversion与-Wno-missing-field-initializers后编译成功

[ 20%] Built target logging_test
Scanning dependencies of target logstream_test
[ 22%] Building CXX object muduo/base/tests/CMakeFiles/logstream_test.dir/LogStream_test.cc.o
[ 22%] Linking CXX executable ../../../bin/logstream_test
/usr/bin/ld: 找不到 -lboost_unit_test_framework
collect2: 错误:ld 返回 1
distcc[106847] ERROR: compile (null) on localhost failed
make[2]: *** [bin/logstream_test] 错误 1
make[1]: *** [muduo/base/tests/CMakeFiles/logstream_test.dir/all] 错误 2
make: *** [all] 错误 2

按你的改法,现在报这个
确认是muduo/base/CMakeLists.txt,而不是muduo/base/tests/CMakeLists.txt吧?

修改muduo/base/CMakeLists.txt, 添加-Wno-conversion与-Wno-missing-field-initializers后编译成功

[ 20%] Built target logging_test Scanning dependencies of target logstream_test [ 22%] Building CXX object muduo/base/tests/CMakeFiles/logstream_test.dir/LogStream_test.cc.o [ 22%] Linking CXX executable ../../../bin/logstream_test /usr/bin/ld: 找不到 -lboost_unit_test_framework collect2: 错误:ld 返回 1 distcc[106847] ERROR: compile (null) on localhost failed make[2]: *** [bin/logstream_test] 错误 1 make[1]: *** [muduo/base/tests/CMakeFiles/logstream_test.dir/all] 错误 2 make: *** [all] 错误 2

按你的改法,现在报这个 确认是muduo/base/CMakeLists.txt,而不是muduo/base/tests/CMakeLists.txt吧?

你改错文件了是muduo/CMakeLists.txt,和muduo同级的那个CMakeLists文件
image

修改muduo/base/CMakeLists.txt, 添加-Wno-conversion与-Wno-missing-field-initializers后编译成功

[ 20%] Built target logging_test Scanning dependencies of target logstream_test [ 22%] Building CXX object muduo/base/tests/CMakeFiles/logstream_test.dir/LogStream_test.cc.o [ 22%] Linking CXX executable ../../../bin/logstream_test /usr/bin/ld: 找不到 -lboost_unit_test_framework collect2: 错误:ld 返回 1 distcc[106847] ERROR: compile (null) on localhost failed make[2]: *** [bin/logstream_test] 错误 1 make[1]: *** [muduo/base/tests/CMakeFiles/logstream_test.dir/all] 错误 2 make: *** [all] 错误 2
按你的改法,现在报这个 确认是muduo/base/CMakeLists.txt,而不是muduo/base/tests/CMakeLists.txt吧?

你改错文件了是muduo/CMakeLists.txt,和muduo同级的那个CMakeLists文件

image

image
还是报错