用make编译openCV报错:ts_gtest.cpp:(.text._ZN7testing8internal2RED2Ev+0xf): undefined reference to 'regfre...

本文解决了一个关于GoogleTest在构建过程中与Boost库中的regex.h文件冲突的问题,通过临时重命名Boost的regex.h文件,避免了GoogleTest寻找通用regex.h的情况,成功解决了编译错误。

解决方案:

the cause is the google tests is looking for the generic regex.h but cmake used the regex.h from boost. and boost is not linked. 

I'm not sure how to fix it properly but renaming /usr/local/include/boost/regex.h temporarily to something else fix the problem.
 
相关cmake的参数:
 
-DENABLE_PRECOMPILED_HEADERS=OFF
-DBUILD_TESTS=OFF
-D WITH_OPENMP=ON
-DGTEST_HAS_POSIX_RE=0

cmake -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_TESTS=OFF -DGTEST_HAS_POSIX_RE=0 -D WITH_OPENMP=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/vision4/VISION/daisida/opencv-3.4.0  -D WITH_GPHOTO2=OFF -D WITH_GTK=OFF -D WITH_CUDA=OFF -D WITH_FFMPEG=OFF -D WITH_LAPACK=OFF ../

  

转载于:https://www.cnblogs.com/sddai/p/10233320.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值