autoware.universe 编译踩坑
Posted KAI-yq
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了autoware.universe 编译踩坑相关的知识,希望对你有一定的参考价值。
fmt相关
版本选择: 8.1.1
下载链接:https://github.com/fmtlib/fmt/releases
报错一
undefined reference to `fmt::v8::vformat[abi:cxx11](fmt::v8::basic_string_view, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)’
打开代码,添加头文件如下:
添加头文件:#define FMT_HEADER_ONLY
#define FMT_HEADER_ONLY
#include <fmt/format.h>
报错二
— stderr: system_monitor
/usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cpu_monitor_lib.dir/build.make:338: libcpu_monitor_lib.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:570: CMakeFiles/cpu_monitor_lib.dir/all] Error 2
重新编译fmt,添加选项:-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE
1.卸载:
cd build
sudo xargs rm < install_manifest.txt
2.重新编译:
mkdir build
cd build
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ..
sudo make install
以上是关于autoware.universe 编译踩坑的主要内容,如果未能解决你的问题,请参考以下文章