当前位置:网站首页>编译报错: undefined reference to `google::FlagRegisterer::FlagRegisterer解决方法
编译报错: undefined reference to `google::FlagRegisterer::FlagRegisterer解决方法
2022-07-30 08:58:00 【wongHome】
一、问题描述
编译报错
CMakeFiles/run_mapping_offline.dir/run_mapping_offline.cc.o: In function `__static_initialization_and_destruction_0': /home/wong/workspace_demo/packagetest_faster_lio_ws/src/***/***/app/run_mapping_offline.cc:16: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' /home/wong/workspace_demo/packagetest_faster_lio_ws/src/***/***/app/run_mapping_offline.cc:17: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/wong/workspace_demo/***/src/***/***/app/run_mapping_offline.cc:18: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' /home/wong/workspace_demo/***/src/***/***/app/run_mapping_offline.cc:19: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' collect2: error: ld returned 1 exit status ***/***/app/CMakeFiles/run_mapping_offline.dir/build.make:678: recipe for target '/home/wong/workspace_demo/***/devel/lib/faster_lio/run_mapping_offline' failed
二、解决方法
自己的解决方法是在 CMakeLists.txt 中添加下列语句:
find_package(gflags REQUIRED)
这个是自己的解决方法,如果不适用屏幕前的朋友,可以参考最后的参考链接。
参考链接
[1] weixin_43767344. undefined reference to ‘google::FlagRegisterer::FlagRegisterer [EB/OL]. https://blog.csdn.net/weixin_43767344/article/details/103799983, 2020-01-02/2022-07-27.
边栏推荐
- leetcode 剑指 Offer 10- II. 青蛙跳台阶问题
- 利用R语言读取csv文件入一个数据框,然后查看各列的属性。
- 回板后,处理器不启动,怎么办?
- 公共Jar包的版本管理
- 经历了这样一个阶段的发展之后,数字零售才能有新的进化
- 团队级敏捷真的没你想的那么简单
- The R installation package has error in rawtochar(block[seq_len(ns)]) :
- The difference between DDR, GDDR, QDR
- 20220728 Use the bluetooth on the computer and the bluetooth module HC-05 of Huicheng Technology to pair the bluetooth serial port transmission
- 积分简明笔记-第一类曲线积分的类型
猜你喜欢

Excel xlsx file not supported两种解决办法【杭州多测师】【杭州多测师_王sir】

涛思 TDengine 2.6+优化参数

信号完整性测试

嘉为鲸翼·多云管理平台荣获信通院可信云技术服务最佳实践

leetcode 剑指 Offer 52. 两个链表的第一个公共节点

仿牛客网项目第二章:开发社区登录模块(详细步骤和思路)

百度paddleocr检测训练

【云原生】Kubernetes入门详细讲解
![[Yugong Series] July 2022 Go Teaching Course 021-Slicing Operation of Go Containers](/img/ff/f3de4952d64afe36c515a2220bfe9d.png)
[Yugong Series] July 2022 Go Teaching Course 021-Slicing Operation of Go Containers

20220728 Use the bluetooth on the computer and the bluetooth module HC-05 of Huicheng Technology to pair the bluetooth serial port transmission
随机推荐
Unity性能分析 Unity Profile性能分析工具
iperf3 参数选项详细说明
TreeSet parsing
Unreal Engine Graphic Notes: could not be compiled. Try rebuilding from source manually. Problem solving
自动化测试selenium(一)
浅论各种调试接口(JTAG、SWD、RDI、Jlink、Ulink、STlink)的区别
els 方块向左移动
leetcode 剑指 Offer 47. 礼物的最大价值
统一异常处理导致ResponseBodyAdvice失效
【无标题】
The use of qsort function and its analog implementation
Farthest Point Sampling - D-FPS vs F-FPS
如何避免CMDB沦为数据孤岛?
C# 之 $ – 字符串内插
积分专题笔记-积分的定义
ACL 2022 | Introduce angular margin to construct comparative learning objectives and enhance text semantic discrimination ability
反射技巧让你的性能提升 N 倍
Windows 下安装 MySQL
知识图谱之Cypher语言的使用
PCB板加工流程中哪些因素会影响到传输线阻抗