Qi Lee 2024-12-07 23:13 采纳率: 0%
浏览 6

零声 微服务IM模块编译报错

零声教育的微服务IM即时通讯 ,IM模块编译报错了,有小伙伴遇到过吗,怎么解决的!

/usr/bin/ld: warning: liblog4cxx.so.10, needed by /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::File::File(char const*)'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::Logger::fatal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::Logger::getLogger(char const*)'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::helpers::ObjectPtrBase::exchange(void**, void*)'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::Logger::trace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::PropertyConfigurator::configureAndWatch(log4cxx::File const&, long)'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::File::~File()'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `typeinfo for log4cxx::helpers::ObjectPtrBase'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::Logger::info(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::helpers::ObjectPtrBase::~ObjectPtrBase()'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::Logger::warn(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::Logger::debug(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: /home/lee/CodingStudio/0voice_im-master/server/src/slog/libslog.so: undefined reference to `log4cxx::helpers::ObjectPtrBase::ObjectPtrBase()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/route_server.dir/build.make:129: route_server] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/route_server.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
make msfs failed

img

  • 写回答

3条回答 默认 最新

  • 关注

    以下回复参考:皆我百晓生券券喵儿等免费微信小程序作答:

    根据你提供的错误信息,这个问题似乎与链接器(ld)有关,它无法正确地链接某些对象或库。这种问题可能有多种原因,包括但不限于:缺少依赖库、库版本不匹配、编译选项不正确等。为了解决这个问题,你可以尝试以下几个步骤:

    1. 检查依赖库:确保你已经安装了所有必要的依赖库,并且它们的版本与你的项目兼容。对于零声教育的微服务IM即时通讯项目,你需要确保已经正确安装了protobuf和log4cxx库。
    2. 清理构建文件:尝试清理项目中的构建文件,然后重新构建。在Linux上,你可以使用make clean命令来清理构建文件。
    3. 检查编译选项:确保你的编译选项正确,特别是与链接器相关的选项。你可以检查CMakeLists.txt文件或其他构建系统配置文件中的链接器选项。
    4. 检查代码错误:检查代码中是否存在错误,特别是与ObjectPtrBase相关的部分。有时候,链接器错误可能是由于代码中存在的错误导致的。
    5. 寻求社区帮助:如果以上步骤都没有解决问题,你可以尝试在相关的开发社区或论坛上寻求帮助。提供详细的错误信息和相关代码片段,以便其他人能够更容易地帮助你。

    关于你提供的图1和图2内容,看起来像是编译IM模块的步骤说明。请确保按照这些步骤正确执行,并且注意每个步骤中的命令拼写和参数是否正确。

    最后,关于你提到的“重金悬赏”,请确保在寻求帮助时尊重他人,并以礼貌的方式寻求解决方案。

    总结起来,你可以尝试清理构建文件、检查依赖库、编译选项和代码错误,并在必要时寻求社区帮助来解决这个问题。希望这些建议能帮助你解决问题!

    评论

报告相同问题?

问题事件

  • 修改了问题 12月8日
  • 修改了问题 12月7日
  • 创建了问题 12月7日