Ask Your Question
0

Cannot open include file: 'opencv2/core/utils/tls.hpp

asked 2019-11-02 05:01:58 -0600

Nori5700 gravatar image

Hi


image description





i use external modules in cmake and check none_free but i get this error

help me plz
i need xfeatures.lib


edit retag flag offensive close merge delete

Comments

helo, please be so kind and replace the useless screenshot with a TEXT version, thank you.

berak gravatar imageberak ( 2019-11-02 05:04:50 -0600 )edit

also: os ? compiler ? opencv version ?

berak gravatar imageberak ( 2019-11-02 05:05:18 -0600 )edit
1

cmake version : 3.16.0-rc2
opencv version : opencv 4.1.2
opencv-contrib version : https://github.com/opencv/opencv_contrib

sorry for my bad language

Nori5700 gravatar imageNori5700 ( 2019-11-02 05:21:42 -0600 )edit

again, please replace the screenshot, and i'll help you.

berak gravatar imageberak ( 2019-11-02 06:00:29 -0600 )edit

I have the same issue right now. I tried to build from 4.1.1 from source as well with the xfeatures2d module included. Visual Studio produces the following error:

Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'opencv2/core/utils/tls.hpp': No such file or directory opencv_world

I cannot find the file tls.hpp anywhere in the source code. In 4.1.1 sift.cpp there is an include line:

include <opencv2 core="" utils="" tls.hpp="">

I noticed this line was not in version 3.4.8.

jchittle gravatar imagejchittle ( 2019-11-02 21:19:13 -0600 )edit

I've met the same problem. on Ubuntu18.04,opencv4.1.2,with CUDA10.1 /home/zhiyu/softWares/OpenCV/opencv-4.1.2/opencv_contrib/modules/xfeatures2d/src/sift.cpp:110:10: fatal error: opencv2/core/utils/tls.hpp: 没有那个文件或目录 #include <opencv2\ core\="" utils\="" tls.hpp=""> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/build.make:482: recipe for target 'modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/sift.cpp.o' failed make[2]: * [modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/sift.cpp.o] Error 1 CMakeFiles/Makefile2:8044: recipe for target 'modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/all' failed make[1]: [modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/all] Error 2 make[1]: ** 正在等待未完成的任务..

zzkld gravatar imagezzkld ( 2019-11-02 23:02:24 -0600 )edit

my cmake command is following: cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D WITH_CUBLAS=ON -D CUDA_FAST_MATH=ON -D WITH_CUFFT=ON -D WITH_NVCUVID=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D BUILD_opencv_cudacodec=ON -D WITH_V4L=ON -D WITH_LIBV4L=ON -D WITH_OPENGL=ON -D WITH_FFMPEG=ON -D WITH_TBB=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -D WITH_QT=ON -D BUILD_opencv_python3=ON -D BUILD_opencv_python2=OFF -D BUILD_opencv_cudacodec=OFF -D ENABLE_PRECOMPILED_HEADERS=OFF -D WITH_GTK_2_X=ON -D WITH_IPP=ON -D WITH_JPEG=ON -D WITH_PNG=ON ..

zzkld gravatar imagezzkld ( 2019-11-02 23:03:47 -0600 )edit

you need EXACTLY the same opencv / opencv_contrib version

your opencv_contrib is from master, the main opencv from 4.1.2 branch.

berak gravatar imageberak ( 2019-11-03 01:51:10 -0600 )edit

thanks very much

zzkld gravatar imagezzkld ( 2019-11-03 02:58:47 -0600 )edit

if you build with opencv_contrib modules, please disable the BUILD_opencv_world option (and build "single module" libs instead.

berak gravatar imageberak ( 2019-11-03 03:06:14 -0600 )edit

2 answers

Sort by » oldest newest most voted
0

answered 2019-11-03 06:02:00 -0600

Thanks berak. You were correct. I was using opencv 4.1.1 but opencv_contrib_master. Using opencv_contrib_4.1.1 solved the issue. I also disabled BUILD_opencv_world option in cmake.

edit flag offensive delete link more

Comments

I have tested this solution and it worked for me. I had to use the same version of opencv and opncv_contrib and the error went away. I would only add that there is no need to disable the world option. I compiled with it and it worked absolutely fine.

guivi01 gravatar imageguivi01 ( 2019-11-05 04:41:53 -0600 )edit
-1

answered 2019-11-05 06:01:18 -0600

Nori5700 gravatar image

I Use This Repository :

https://github.com/developerNori/Open...

OpencvLibrary lib Files

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-11-02 05:01:58 -0600

Seen: 2,259 times

Last updated: Nov 05 '19