Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error!!! How to fix it? #720

Open
1716285375 opened this issue Feb 27, 2025 · 4 comments
Open

Build Error!!! How to fix it? #720

1716285375 opened this issue Feb 27, 2025 · 4 comments

Comments

@1716285375
Copy link

`rl@rl-Z490-AORUS-PRO-AX:~/jie/download-files/muduo$ ./build.sh

  • pwd

  • SOURCE_DIR=/home/rl/jie/download-files/muduo

  • BUILD_DIR=../build

  • BUILD_TYPE=release

  • INSTALL_DIR=../release-install-cpp11

  • CXX=g++

  • ln -sf ../build/release-cpp11/compile_commands.json

  • mkdir -p ../build/release-cpp11

  • cd ../build/release-cpp11

  • cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=../release-install-cpp11 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON /home/rl/jie/download-files/muduo
    CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument value or use a ... suffix to tell
    CMake that the project does not need compatibility with older versions.

-- Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR)
-- found curl
-- found zlib
-- CXX_FLAGS = -g -DCHECK_PTHREAD_RETURN_VALUE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wconversion -Wno-unused-parameter -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=native -std=c++11 -rdynamic -O2 -DNDEBUG
-- Configuring done (0.1s)
-- Generating done (0.2s)
-- Build files have been written to: /home/rl/jie/download-files/build/release-cpp11

  • make
    [ 4%] Built target muduo_base
    [ 4%] Built target asynclogging_test
    [ 6%] Built target atomic_unittest
    [ 7%] Built target blockingqueue_test
    [ 8%] Built target blockingqueue_bench
    [ 8%] Built target blockingqueue_bench2
    [ 8%] Built target boundedblockingqueue_test
    [ 9%] Built target date_unittest
    [ 10%] Built target exception_test
    [ 12%] Built target fileutil_test
    [ 12%] Built target fork_test
    [ 13%] Built target gzipfile_test
    [ 13%] Built target logfile_test
    [ 14%] Built target logging_test
    [ 14%] Built target logstream_bench
    [ 15%] Built target logstream_test
    [ 17%] Built target mutex_test
    [ 18%] Built target processinfo_test
    [ 18%] Built target singleton_test
    [ 19%] Built target singleton_threadlocal_test
    [ 20%] Built target thread_bench
    [ 20%] Built target thread_test
    [ 21%] Built target threadlocal_test
    [ 21%] Built target threadlocalsingleton_test
    [ 23%] Built target threadpool_test
    [ 24%] Built target timestamp_unittest
    [ 24%] Built target timezone_unittest
    [ 25%] Built target timezone_util
    [ 31%] Built target muduo_net
    [ 32%] Built target muduo_http
    [ 34%] Built target httpserver_test
    [ 34%] Built target httprequest_unittest
    [ 35%] Built target muduo_inspect
    [ 36%] Built target inspector_test
    [ 37%] Built target channel_test
    [ 39%] Built target echoserver_unittest
    [ 39%] Built target echoclient_unittest
    [ 39%] Built target eventloop_unittest
    [ 40%] Built target eventloopthread_unittest
    [ 40%] Built target eventloopthreadpool_unittest
    [ 41%] Built target buffer_unittest
    [ 41%] Built target inetaddress_unittest
    [ 42%] Built target zlibstream_unittest
    [ 43%] Built target tcpclient_reg1
    [ 43%] Built target tcpclient_reg2
    [ 45%] Built target tcpclient_reg3
    [ 45%] Built target timerqueue_unittest
    [ 46%] Linking CXX executable ../../../bin/ttcp_blocking
    /usr/bin/ld: CMakeFiles/ttcp_blocking.dir/common.cc.o: in function boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)': /home/rl/anaconda3/include/boost/program_options/detail/parsers.hpp:62:(.text._ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESJ_ERKSJ_EE[_ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESJ_ERKSJ_EE]+0xc8): undefined reference to boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&>)'
    collect2: error: ld returned 1 exit status
    make[2]: *** [examples/ace/ttcp/CMakeFiles/ttcp_blocking.dir/build.make:130: bin/ttcp_blocking] Error 1
    make[1]: *** [CMakeFiles/Makefile2:2505: examples/ace/ttcp/CMakeFiles/ttcp_blocking.dir/all] Error 2
    make: *** [Makefile:146: all] Error 2
    `
    what's wrong with this?
@chenshuo
Copy link
Owner

Please follow the issue template https://github.com/chenshuo/muduo/blob/master/.github/ISSUE_TEMPLATE/bug_report.md

Especially:

  • 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.)

@1716285375
Copy link
Author

Linux: ubuntu 24.02 x86 64bit cmake : 3.28.3 gcc: 13.3.0 boost: 1,87,0 muduo: branch master

@chenshuo
Copy link
Owner

chenshuo commented Mar 6, 2025

Is this error reproducible with libboost-dev installed by apt? Ubuntu 24.04 LTS has boost 1.74 and Ubuntu 24.10 has boost 1.83. Both should work fine.

If you download and compile Boost by yourself, maybe it's not properly installed.

@1716285375
Copy link
Author

Is this error reproducible with libboost-dev installed by apt? Ubuntu 24.04 LTS has boost 1.74 and Ubuntu 24.10 has boost 1.83. Both should work fine.

If you download and compile Boost by yourself, maybe it's not properly installed.

yeah, I got boost from source code, not from prepared installed in linux system. so I fix this to install the boost library from linux system. thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants