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

解决方案:

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 ../

  

猜你喜欢

转载自blog.csdn.net/weixin_34049032/article/details/86445031
今日推荐