chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.83k stars 5.17k forks source link

old-style #398

Closed txkgithub closed 5 years ago

txkgithub commented 5 years ago

GitHub issues are for tracking bugs, not for general discussing like a forum.

If you have a general question to ask, send it to mailing list:

muduo-library@googlegroups.com

Or visit: https://groups.google.com/forum/#!forum/muduo-library

When file an issue muduo, please provide a SSCCE: Short, Self Contained, Correct (Compilable), Example.

Also specify the exact environment where the issue occurs:

Linux distro and version? x86 or ARM? 32-bit or 64-bit?

Branch (cpp98/cpp11/cpp17) and version of muduo?

Version of cmake, gcc and boost? (If not from distro.)

txkgithub commented 5 years ago

linux arm32 bit cpp98 boost_1_53_0 In file included from /opt/imx6/include/boost/concept/detail/general.hpp:11:0, from /opt/imx6/include/boost/concept/assert.hpp:36, from /opt/imx6/include/boost/concept_check.hpp:20, from /opt/imx6/include/boost/circular_buffer/base.hpp:17, from /opt/imx6/include/boost/circular_buffer.hpp:65, from /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/BoundedBlockingQueue.h:12, from /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/AsyncLogging.h:5, from /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/AsyncLogging.cc:1: /opt/imx6/include/boost/concept/detail/has_constraints.hpp:42:5: error: use of old-style cast [-Werror=old-style-cast] In file included from /opt/imx6/include/boost/concept/assert.hpp:36:0, from /opt/imx6/include/boost/concept_check.hpp:20, from /opt/imx6/include/boost/circular_buffer/base.hpp:17, from /opt/imx6/include/boost/circular_buffer.hpp:65, from /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/BoundedBlockingQueue.h:12, from /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/AsyncLogging.h:5, from /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/AsyncLogging.cc:1: /opt/imx6/include/boost/concept/detail/general.hpp: In static member function 'static void boost::concepts::requirement::failed()': /opt/imx6/include/boost/concept/detail/general.hpp:30:37: error: use of old-style cast [-Werror=old-style-cast] /opt/imx6/include/boost/concept/detail/general.hpp: In static member function 'static void boost::concepts::requirement<boost::concepts::failed**** Model::****>::failed()': /opt/imx6/include/boost/concept/detail/general.hpp:38:37: error: use of old-style cast [-Werror=old-style-cast] /opt/imx6/include/boost/concept/detail/general.hpp: In static member function 'static void boost::concepts::constraint::failed()': /opt/imx6/include/boost/concept/detail/general.hpp:46:37: error: use of old-style cast [-Werror=old-style-cast]

chenshuo commented 5 years ago

Try removing -Werror from CMakeLists.txt if you install boost outside /usr/include.

txkgithub commented 5 years ago

thanks,after modification, new problems appear as follows: Scanning dependencies of target atomic_unittest [ 32%] Building CXX object muduo/base/tests/CMakeFiles/atomic_unittest.dir/Atomic_unittest.cc.o [ 33%] Linking CXX executable ../../../bin/atomic_unittest CMakeFiles/atomic_unittest.dir/Atomic_unittest.cc.o: In function muduo::detail::AtomicIntegerT<long long>::getAndAdd(long long)': /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/Atomic.h:47: undefined reference to__sync_fetch_and_add_8' collect2: ld returned 1 exit status muduo/base/tests/CMakeFiles/atomic_unittest.dir/build.make:83: recipe for target 'bin/atomic_unittest' failed

now CMakeLists.txt SET(CMAKE_SYSTEM_NAME Linux)

this one not so much

SET(CMAKE_SYSTEM_VERSION 1)

specify the cross compiler

SET(CMAKE_C_COMPILER arm-linux-gcc) SET(CMAKE_CXX_COMPILER arm-linux-g++) SET(CMAKE_STRIP arm-linux-strip)

where is the target environment

SET(CMAKE_FIND_ROOT_PATH /opt/imx6)

project(muduo C CXX) enable_testing()

if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif()

option(MUDUO_BUILD_EXAMPLES "Build Muduo examples" OFF)

set(CXX_FLAGS -g

-DVALGRIND

-DMUDUO_STD_STRING

-DCHECK_PTHREAD_RETURN_VALUE -D_FILE_OFFSET_BITS=64 -Wall -Wextra

-Werror

-Wconversion -Wno-unused-parameter -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9

-MMD

-std=c++0x

-rdynamic )

chenshuo commented 5 years ago

Version of gcc?

On Thu, Jul 25, 2019, 7:18 PM txkgithub notifications@github.com wrote:

thanks,after modification, new problems appear as follows: Scanning dependencies of target atomic_unittest [ 32%] Building CXX object muduo/base/tests/CMakeFiles/atomic_unittest.dir/Atomic_unittest.cc.o [ 33%] Linking CXX executable ../../../bin/atomic_unittest CMakeFiles/atomic_unittest.dir/Atomic_unittest.cc.o: In function muduo::detail::AtomicIntegerT<long long>::getAndAdd(long long)': /home/xokai/develop/opensourcelib-arm/muduo/muduo/base/Atomic.h:47: undefined reference to __sync_fetch_and_add_8' collect2: ld returned 1 exit status muduo/base/tests/CMakeFiles/atomic_unittest.dir/build.make:83: recipe for target 'bin/atomic_unittest' failed

now CMakeLists.txt SET(CMAKE_SYSTEM_NAME Linux)

this one not so much

SET(CMAKE_SYSTEM_VERSION 1) specify the cross compiler

SET(CMAKE_C_COMPILER arm-linux-gcc) SET(CMAKE_CXX_COMPILER arm-linux-g++) SET(CMAKE_STRIP arm-linux-strip) where is the target environment

SET(CMAKE_FIND_ROOT_PATH /opt/imx6)

project(muduo C CXX) enable_testing()

if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif()

option(MUDUO_BUILD_EXAMPLES "Build Muduo examples" OFF)

set(CXX_FLAGS -g -DVALGRIND -DMUDUO_STD_STRING

-DCHECK_PTHREAD_RETURN_VALUE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Werror

-Wconversion -Wno-unused-parameter -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -MMD -std=c++0x

-rdynamic )

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chenshuo/muduo/issues/398?email_source=notifications&email_token=AABYNIRHUAIUW754DTLNVD3QBJNJBA5CNFSM4IEOX57KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD23JNPA#issuecomment-515282620, or mute the thread https://github.com/notifications/unsubscribe-auth/AABYNIWV7CCOZT7FRRH2AJDQBJNJBANCNFSM4IEOX57A .

txkgithub commented 5 years ago

xokai@build$ arm-linux-gcc -v Using built-in specs. COLLECT_GCC=arm-linux-gcc COLLECT_LTO_WRAPPER=/home/xokai/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../libexec/gcc/arm-fsl-linux-gnueabi/4.6.2/lto-wrapper Target: arm-fsl-linux-gnueabi Configured with: /work/build/.build/src/gcc-linaro-4.6-2011.06-0/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-fsl-linux-gnueabi --prefix=/work/fsl-linaro-toolchain-2.13 --with-sysroot=/work/fsl-linaro-toolchain-2.13/arm-fsl-linux-gnueabi/multi-libs --enable-languages=c,c++ --with-pkgversion='Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --with-gmp=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-mpfr=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-mpc=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-ppl=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-cloog=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-libelf=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm -L/work/build/.build/arm-fsl-linux-gnueabi/build/static/lib -lpwl' --enable-threads=posix --enable-target-optspace --enable-plugin --enable-multilib --with-local-prefix=/work/fsl-linaro-toolchain-2.13/arm-fsl-linux-gnueabi/multi-libs --disable-nls --enable-c99 --enable-long-long --with-system-zlib Thread model: posix gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20)

chenshuo commented 5 years ago

maybe try newer gcc?