Apollo代码提取移植错误提示总结

2019-04-01  本文已影响0人  andyhacker

1. protobuf的安装及proto文件的编译

2. [undefined reference to testing::internal::xxx in gtest]

未安装gtest模块,可安装此模块或者屏蔽test测试代码
或者安装gtest后,在CmakLists.txt 中加入gtest链接

target_link_libraries(
 ${PROJECT_NAME}
 ...
 gtest
)

3. fLB::FLAGS_xxx’未定义的引用

find_package(gflags REQUIRED)
...
target_link_libraries(
 ${PROJECT_NAME}
 ...
 gflags
)

4. 对‘google::base::CheckOpMessageBuilder::NewString()’未定义的引用

5. 运行时崩溃,Segmentation fault of google::protobuf::Arena::OnArenaAllocation

应是由于protobuf版本混乱导致,可使用ldd查看是否依赖两个版本的protobuf库,
可参考https://github.com/protocolbuffers/protobuf/issues/4723

6. 对‘apollo::hdmap::LaneInfo::GetProjection(apollo::common::math::Vec2d const&, double, double) const’未定义的引用

7. 对‘qpOASES::QProblemB::getPrimalSolution(double*) const’未定义的引用

添加链接依赖项 qpOASES
首先下载并编译qpOASES,加入环境变量,然后添加链接依赖项

target_link_libraries(
 ${PROJECT_NAME}
 ...
 qpOASES
)

8. 对‘tinyxml2::XMLNode::NextSiblingElement(char const*) const’未定义的引用

target_link_libraries(
 ${PROJECT_NAME}
 ...
 tinyxml2
)

9. 对‘pj_free’未定义的引用

target_link_libraries(
 ${PROJECT_NAME}
 ...
 proj
)

10. warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]

error: inlining failed in call to always_inline ‘__m256 _mm256_setzero_ps()’: target specific option

insert this line to CMakeLists.txt

add_compile_options(-march=native)

11. fatal error: Eigen/Core: 没有那个文件或目录

find_package(Eigen3 REQUIRED)
...
include_directories(
  ${EIGEN3_INCLUDE_DIRS}
  ...
)
...
target_link_libraries(${PROJECT_NAME}
  ${EIGEN3_LIBRARIES}
  ...
)

12. error: ‘__s_getMD5Sum’ is not a member of ‘xxx::xxx::xxx’

添加头文件支持

#include "modules/xxx/proto/xxx.ros.h"

13. fatal error: ros/include/ros/ros.h: 没有那个文件或目录

修改
#include "ros/include/ros/ros.h"
为
#include "ros/ros.h"

14. 对‘xxx’未定义的引用

Reference lib
glfwGetWindowUserPointer glfw
YAML yaml-cpp
perception_common

15. libgtest.a(gtest-all.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

/usr/local/lib/libgtest.a: 无法添加符号: 错误的值
参考:https://github.com/google/googletest/issues/854
重新编译安装googletest

cd <path>
git clone https://github.com/google/googletest.git
vim CMakeLists.txt  
// add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
mkdir build
cd build
cmake ..
make -j12
sudo make install

99. 支持

1) glog gfalgs
参考
https://www.cnblogs.com/burningTheStar/p/6986048.html
2) curlpp

  1. leveldb

sudo apt install libleveldb-dev
4)protobuf-3.6.1

https://blog.csdn.net/datase/article/details/82347834
安装完成之后,记得头文件拷贝
sudo cp src/google/protobuf/stubs/*.h /usr/local/protobuf/include/google/protobuf/stubs/
5) qpOASES-3.2.1

上一篇 下一篇

猜你喜欢

热点阅读