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
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值