Fork me on GitHub

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

解决方案:

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

  

posted @ 2019-01-07 15:02  stardsd  阅读(1331)  评论(0编辑  收藏  举报