用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 ../
如果这篇文章帮助到了你,你可以请作者喝一杯咖啡
![](https://img2020.cnblogs.com/blog/938105/202010/938105-20201013171833350-276632012.png)