For those who have trouble creating the CMake file, if the extension does not prompt you with the "create new cmkae file", just do this Ctrl+Shift+P Cmake:Qick Start
Thanks so much for helping me get past the setup xD It's honestly insane to me how convoluted it is just to startup a project, but I guess im just a noob lol Im a somewhat experienced dev, but I usually only work on projects that my coworkers started decades ago. Rarely get to work on my own projects from the ground up.
About the compiler, a useful command is ctrl + shift + p > then cmake: select kit. For some reason gcc compiler didn't work out, but the one used in this video is working ok.
I got an error on this line Could not find a package configuration file provided by "OpenCV" with any of the following names: OpenCVConfig.cmake opencv-config.cmake Where and how can I fix it? Thanks!
Late comment, but thank you! This video is still helping people like me! How in the name could I have found things like this out without needing to depend on the chance that a kind soul like you has made a video on it? Genuinely asking
Thanks a lot for watching and glad that it could help u! It will take a long time to figure out for urself and a bit of knowledge about cmake, how editors work and so on.
Don't know if anyone else encountered the problem when you ctrl+p and click Cmake: configure then it doesn't give you the amdx86(kits)... You could go to the very bottom of vscode and select no active kits::::will take you to the kits .. Had this error for the last day....tip for those who might encounter the same problem
Hey! Thanks for the help. I have a question though, I just tried to add another cpp file in my folder. It's working so far but I get an error in the include command and I can't just add that file name to my CMake.txt as well. What do I do?
Well. Now it says build finished with Error 2. I got to say yours was the most useful thing i found so far about how to set this up for vs code. Im on linux though so things are different i guess. I have followed like 10 different tutorials so far and it all falls apart at some point. maybe i should stop trying to learn coding if i cant even work with libraries.
Hi Yeah Linux is a bit different since u need visual studio 2019 c++ development tool to be able to do it this way. It's not available on Linux. Definitely don't give up on coding because of libraries. It's not the easiest if u are just starting out. My recommendation would be to start more simple and make tale a look at python first and get familiar with everything and then read up on libraries and cmake
Yeah u should definitely look into how to link to the binaries of the libraries. Often cmake is used to set up and link libraries, at least if u just want to set up some projects fast. So take a look at some cmake tutorials and so on and maybe start out with windows unless u need Linux for some specific things. I prefer Linux too but lost things out on the internet are in windows of what I have seen. Can be done in Linux easily but u need some knowledge about how it works and how to do it of course
I followed everything exactly but I have errors on the file that adds the #include #include errors detected based on information provided by the configuration Provider setting. Squiggles are disabled for this translation unit
Cmake file doesn't work anymore: CMake Error at CMakeLists.txt:7 (find_package):By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one. Could not find a package configuration file provided by "OpenCV" with any of the following names: OpenCVConfig.cmake opencv-config.cmake Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" provides a separate development package or SDK, be sure it has been installed.
Installed OpenCV on D:/. At first, it seems CMake couldn't find it, but after running "CMake: Delete cache and Reconfigure" it worked. Great tutorial, but please reduce your word flow in the future, it's quite hard to listen to.
When i run the program i get the error: opencv2/opencv.hpp: no such directory. I have installed everything as per your instructions and also set the path in environment variables. Plz help
Check the PATH variable u have to add from the description, if that is correct as u say, then i can only see that it's OpenCV that is not installed correctly
Thanks for the video. This error appears to me, how do I solve it Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set [cmake] "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" [cmake] provides a separate development package or SDK, be sure it has been [cmake] installed.
Hi thanks so much for this video. I keep getting this error :-( "Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable." This happens when I select Cmake:configure, and select my minGW compiler Would really appreciate any fix for this.
at 7:17 I got an error main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found. Also there is no create button. The button in the video is hidden by your picture.
When I try to configurate cmake, there is no option that include visual studio community release; just gcc ones. Am I have to download visual studio too or there's another way to configurate cmake?
Great video. Although it must be mentioned that one need to install visual studio (for c++ compiler) before as well as visual studio code (vs code). I had mingw installed as compiler for using c++ in vs code and this was not compatible with opencv and was giving "mutex error".
When I try to configure cmake, the only two options that show up are "Browse for CmakeLists.txt" or "Dont show Again" none of my compilers show up. What should I do?
Hi, getting a bunch of "undefined reference" Errors when i try to build the project (for every CV call). But it doesn't show any errors in code and ctrl-space shows all possible functions... Update: After restarting it doesn't find the functions anymore and i get an error on #include
@@datisreyhani4641 u can either compile and run it in debug or release mode. In the video i configure it in cmake with release mode and do it in vscode aswell
@@NicolaiAI Thanks! It turns out it didn't work because of something I'd accidentally done, so when I deleted it and re-followed your tutorial it worked perfectly! I cannot thank you enough!
Thanks for the information. I get an error saying "No such file or directory" for running the .exe file even though i can see the .exe file in the buld>Debug folder is there a fix for this?
Hello, I am doing the steps according to the video. But facing issues while configure_cmake. Receiving error as : Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Could you please tell what has to be done
Hey, I'm experiencing an issue where at 7:04, I only see the first two options. I have read a few other comments with people having the same issue but I still cannot rectify my problem. I have all extensions you've mentioned in the video installed, I have uninstalled Visual Studio Code and reinstalled but nothing has changed. Any advice on what I'm doing wrong?
@@NicolaiAI Thanks so much, I thought I had 2019 installed but I had the 2022 version and it wasn't working but fixed now. Really appreciate the quick reply! Will definitely be using your vids in the future.
Hi. What button or key combination did you press on 7:35? Most interesting when from 60000 people jut me can't go further just because don't know how to create executable project...
@@NicolaiAI I have already setup this, requirements were different, you have mentioned here, Visual studio(not visual studio code) and c++ development are required.
@@Tesla_News_Space_X_Musk bro, was the same for me. I needed to installed Visual Studio Community first. Checkout when you elected the compiler, its says "Visual Studio Community". And when you install VSComunnity, select the option for C/C++ developers and then just follow the video. The video is just amazing, excellent content! Keep it up!
Hello, I did everything like in the Video, but I get the error: opencv2/opencv.hpp: no such file or directory gcc And I dont know what to do, please help
@@NicolaiAI In the Cmake conf at 7:04 I only had the first 3 to choose from, so I selected MIngw bc I usually used it for my projects I did instaall all the extensions as you showed
I am not sure why, but I am unable to find the extensions that you use. I have searched for them; however, none of them show up for me. Does anyone know what I might have done wrong?
Excelent video! But, I'm sorry, I have an error. On a minute 10:18 when you write "target_link_libraries( opencv-setup ${OpenCV_LIBS} )", I've an error: "CMake Error at CMakeLists.txt:12 (target_link_libraries):Cannot specify link libraries for target "opencv-setup" which is not built by this project" Why? And what I have to do to resolve it? Thank you very much!
Unfortunately none of this worked for me. Tried cmake:Quick Start, still getting "unable to determine what CMake generator to use. VS still can't find a compiler. Using latest version of VS. OpenCV and CMake. Totally disappointed especially because all of his other videos have been great.
Hi, great tutorial it help me a lot to get started. I have a question, when you do CMake: Configure -> create a new file...etc. 7:58 CMake generate CMakelist.txt, main.cpp and some other files files. Is there a way to customize those files? I will like to have those, custom made for me
Can anyone guide ma about "opencv2\face.hpp" i want to include it but i am getting an error "cannot open source file opencv2\face.hpp". No solution found anywhere online. I am using Visual Studio C++ 2022
Yes u have most likely chosen the wrong architecture for the project/cmake configuration. It depends on what architecture u have installed opencv for but u are most likely looking for x86. Try check in the blue bar at the bottom of vscode
The latest VS code has bug which not allowed to connect to opencv library while debugging , even setup all environment and path, so i had gave up using VS code for coding.
thanks for the video but i keep getting error main.cpp:2:31: fatal error: opencv2/highgui.hpp: No such file or directory #include ^ compilation terminated. although added the opencv to path
For people getting the linking errors ( LNK2019 LNK4272 LNK1120 ), select a different kit, shift+ctrl & P --> "Select a Kit" and choose something different, maybe amd64 and build again after a few seconds.
Hey, Thanks for the video. I did exactly what you showed in the video but I get an error with opencv header files not found: main.cpp:2:10: fatal error: opencv2/opencv.hpp: No such file or directory 2 | #include | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
@@BlacksoulRider Hey, I know it's far fetched cause you have done it ages ago, but did you figure out why this happened? I have the same problem. I would be most grateful.
@@veljkojovanovic2152 Unfortunately, NO, it didn't work in VS code for some reason. However, I built opencv from source using Cmake and continued using Visual Studio Community.
Hi, I can complie the .cpp file like the video indicates([build] Build finished with exit code 0), but when I run I got following error on the terminal: [ WARN:0@0.015] global C:\build\master_winpack-build-win64-vc15\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('Resources/test.png'): can't open/read file: check file path/integrity No image data (I'm sure the image payh is correct.) can anybody help, please??
I encountered a small problem at 7:04. VS code shows only 3 options: 1.[Scan for kits] Search for compilers on this computer 2.[unspecified] Unspecified (Let Cmake guess what compiler and environment to use) 3. GCC 8.1.0 i686-mngw32 Using compilers: C=C:\...... which one do I select? I am trying perform watermarking on 1080p images using only c.
Hey I had the same problem all day, I resolved the issue by installing Visual Studio 2019 Community. Those three option you have are the compilers you can use however, in the tutorial we see The Coding Lib select the Visual Studio 2019 Community Release. Hopefully that helped be sure to install it, run it and set it up and the other options should populate.
I got this Error please help !! CMake Error at CMakeLists.txt:7 (find_package): [cmake] Found package configuration file: [cmake] [cmake] C:/DEV/opencv/build/OpenCVConfig.cmake [cmake] [cmake] but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be [cmake] NOT FOUND.
Hello, thanks for the great videos! I have had issues for 2 days, I can't make it. So I followed steps like u said, create PATH for env, then configure CMAKE, but [cmake] CMake Error at CMakeLists.txt:2 (project): [cmake] Generator [cmake] [cmake] Visual Studio 17 2022 [cmake] [cmake] could not find any instance of Visual Studio. I found this error, and Idk what to do. Thank you!
Hello! Tank you very much for this video! i tried to install all components. but i have some failures: Error LNK 2019, LNK 4272 - 7:00 i use the release - X86, fatal error LNK 1120. can you help me? its my first project in Virtual Studio. it would be very helpful if you can explain how i can fix these failures. with best regards stefan
This tutorial is unusable for any extensive development with OpenCV and CMake. It's nice it works for You but honestly this is in no way documenting a proper way of OpenCV installation and usage. Especially if You are using any kind of version control.
And to be clear I'm not building OpenCV from source files but using the installed package. Make sure to check the channel out before leaving random comments if u are going to make comments. Ur comment is for no use since i have several videos building OpenCV from source files with different versions and so on.
If someone is having this error in WINDOWS10: [cmake] Could not find a package configuration file provided by "OpenCV" with any [cmake] of the following names: [cmake] [cmake] OpenCVConfig.cmake [cmake] opencv-config.cmake What to do: add to CMakeLists.txt the following: set(OpenCV_DIR "/opencv/build") before include_directories( ${OpenCV_INCLUDE_DIRS} )
@@datisreyhani4641 hi! My problem was that I hadn't created the environmental variable for OpenCV, when I created it then everything worked fine, the variable that I created was OpenCV_DIR that is the path to the lib directory
For those who have trouble creating the CMake file, if the extension does not prompt you with the "create new cmkae file", just do this Ctrl+Shift+P Cmake:Qick Start
You are a godsend ... I was wracking my brains for the last 10 minutes. "Like I'm sure I followed the video properly" 😅
It worked thank you so much
Thank you
Thank you!
wow thank you very much!
holy hell the setup is brutal
Thanks so much for helping me get past the setup xD
It's honestly insane to me how convoluted it is just to startup a project, but I guess im just a noob lol
Im a somewhat experienced dev, but I usually only work on projects that my coworkers started decades ago. Rarely get to work on my own projects from the ground up.
About the compiler, a useful command is ctrl + shift + p > then cmake: select kit.
For some reason gcc compiler didn't work out, but the one used in this video is working ok.
Finally! a tutorial that actually worked for me... Thank you Soooooo much for this!
Thanks man! Glad it helped
I got an error on this line
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Where and how can I fix it?
Thanks!
It helps me (write before find_packages command) set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /opencv/build/x64/vc15/lib/)
Late comment, but thank you! This video is still helping people like me! How in the name could I have found things like this out without needing to depend on the chance that a kind soul like you has made a video on it? Genuinely asking
Thanks a lot for watching and glad that it could help u! It will take a long time to figure out for urself and a bit of knowledge about cmake, how editors work and so on.
Don't know if anyone else encountered the problem when you ctrl+p and click Cmake: configure then it doesn't give you the amdx86(kits)...
You could go to the very bottom of vscode and select no active kits::::will take you to the kits
..
Had this error for the last day....tip for those who might encounter the same problem
What is very button?? I couldn’t find that
Hey! Thanks for the help. I have a question though, I just tried to add another cpp file in my folder. It's working so far but I get an error in the include command and I can't just add that file name to my CMake.txt as well. What do I do?
Well. Now it says build finished with Error 2.
I got to say yours was the most useful thing i found so far about how to set this up for vs code.
Im on linux though so things are different i guess. I have followed like 10 different tutorials so far and it all falls apart at some point. maybe i should stop trying to learn coding if i cant even work with libraries.
Hi Yeah Linux is a bit different since u need visual studio 2019 c++ development tool to be able to do it this way. It's not available on Linux. Definitely don't give up on coding because of libraries. It's not the easiest if u are just starting out. My recommendation would be to start more simple and make tale a look at python first and get familiar with everything and then read up on libraries and cmake
Yeah u should definitely look into how to link to the binaries of the libraries. Often cmake is used to set up and link libraries, at least if u just want to set up some projects fast. So take a look at some cmake tutorials and so on and maybe start out with windows unless u need Linux for some specific things. I prefer Linux too but lost things out on the internet are in windows of what I have seen. Can be done in Linux easily but u need some knowledge about how it works and how to do it of course
Awesome video, keep up the incredible work! :)
Thank you very much! It really helps me to keep going :)
I followed everything exactly but I have errors on the file that adds the #include
#include errors detected based on information provided by the configuration Provider setting. Squiggles are disabled for this translation unit
were you able to solve it? did you get the error after the build? or even before you built it?
nice video
honestly compared to visual studio integration it s simpler using cmake
Thank you! Yes its way simpler to set up in vscode and for smaller projects. I'll still prefer visual studio for larger projects
Cmake file doesn't work anymore:
CMake Error at CMakeLists.txt:7 (find_package):By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.
Installed OpenCV on D:/. At first, it seems CMake couldn't find it, but after running "CMake: Delete cache and Reconfigure" it worked. Great tutorial, but please reduce your word flow in the future, it's quite hard to listen to.
Would you consider remaking this video for the most recent versions of windows, opencv, and vscode?
Yeah I should def do that Andrew! Thanks for the tip
why do I get an error while using GCC compiler while following this tutorial, should I install and use Visual Studio Community compiler?
7:23 - Your webcam is blocking the part of the screen, I can't see what you clicked on there. Help please?
Day 1 done
Cool man! Thats commitment
When i run the program i get the error: opencv2/opencv.hpp: no such directory.
I have installed everything as per your instructions and also set the path in environment variables. Plz help
Check the PATH variable u have to add from the description, if that is correct as u say, then i can only see that it's OpenCV that is not installed correctly
@@NicolaiAI i checked it. I have put the opencv folder in my c drive. I still can't find what's wrong. My path variables are also correct
@@songoku-lo7il you may forget building the project as well. I.o.w. if you run without building you get this error as well.
Hey man, maybe it's a long shot since you have done this a year ago, but did you resolve this and do you maybe remember how?
Thanks for the video.
This error appears to me, how do I solve it
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
[cmake] "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
[cmake] provides a separate development package or SDK, be sure it has been
[cmake] installed.
CMake was unable to find a build program corresponding to "MinGW Makefiles".
Hi thanks so much for this video. I keep getting this error :-( "Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable."
This happens when I select Cmake:configure, and select my minGW compiler
Would really appreciate any fix for this.
I believe this is a bug, on vscode, select an older version of Cmake Tools and that should work (I had the same problem and that's how I fixed it)
@@dionfrancois5649 I have the same bug, do you know how to select an older version of cmake tools?
@@cameronkerr6258 you can also swap to the visual studio community compiler instead of minGW if on windows
at 7:17 I got an error main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found. Also there is no create button. The button in the video is hidden by your picture.
Please..if you fixed it tell me the way....I got just the same error
When I try to configurate cmake, there is no option that include visual studio community release; just gcc ones. Am I have to download visual studio too or there's another way to configurate cmake?
You will have to install visual studio to build on windows
you need to zoom in to the screen because the file names on your file explorer appear too small in size
Great video. Although it must be mentioned that one need to install visual studio (for c++ compiler) before as well as visual studio code (vs code). I had mingw installed as compiler for using c++ in vs code and this was not compatible with opencv and was giving "mutex error".
so were you able to make it work with mingiw as a compiler or did you had to change to visual studio for compiling?
Yes lol, was trying to build pthread and what not from source, easiest thing to do is just download c++ from vs code.
When I try to configure cmake, the only two options that show up are "Browse for CmakeLists.txt" or "Dont show Again" none of my compilers show up. What should I do?
Same here
Thenkiu so much. From Vietnam with love
Thank you! Glad that u like it
Hi, getting a bunch of "undefined reference" Errors when i try to build the project (for every CV call). But it doesn't show any errors in code and ctrl-space shows all possible functions...
Update: After restarting it doesn't find the functions anymore and i get an error on #include
Same 🫤
Hey, thanks for the video! Just wanted to ask how to fix an error in the 'find_package(OpenCV REQUIRED)' command causing it to be flagged up.
Thanks!
Make sure u have everything in release mode and have the path variable as i have in the description
@@NicolaiAI I have the environment variables exactly as you did in the video, but what do you mean by release mode? Thx
@@datisreyhani4641 u can either compile and run it in debug or release mode. In the video i configure it in cmake with release mode and do it in vscode aswell
@@NicolaiAI Thanks! It turns out it didn't work because of something I'd accidentally done, so when I deleted it and re-followed your tutorial it worked perfectly! I cannot thank you enough!
Great that u figured it out! Enjoy
Can you do a video about installing the opencv-contrib modules when you already have the opencv core installed
CMake Error at CMakeLists.txt:2 (project):Running
'nmake' '-?'
failed with:
no such file or directory
can someone help me with this
Thanks for the information. I get an error saying "No such file or directory" for running the .exe file even though i can see the .exe file in the buld>Debug folder is there a fix for this?
could you solve it?
What is the role of installing CMAKE software?
Could i work with vscode and opencv without installing cMake?
same process for mac? or can you please do one for mac... been struggling with the installation and set up for a while.
Hello, I am doing the steps according to the video. But facing issues while configure_cmake. Receiving error as : Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Could you please tell what has to be done
I have the same issue, did you find a solution?
Hey, I'm experiencing an issue where at 7:04, I only see the first two options. I have read a few other comments with people having the same issue but I still cannot rectify my problem. I have all extensions you've mentioned in the video installed, I have uninstalled Visual Studio Code and reinstalled but nothing has changed. Any advice on what I'm doing wrong?
Do u have visual studio 2019 with c++ development tool installed?
@@NicolaiAI Thanks so much, I thought I had 2019 installed but I had the 2022 version and it wasn't working but fixed now. Really appreciate the quick reply! Will definitely be using your vids in the future.
Thanks for watching! Glad that i can help
Hi. What button or key combination did you press on 7:35? Most interesting when from 60000 people jut me can't go further just because don't know how to create executable project...
Ctrl+Shift+P, CMake:Quick start,Then can create executable project.
Join My AI Career Program
👉 www.nicolai-nielsen.com/aicareer
Enroll in My School and Technical Courses
👉 www.nicos-school.com
Great video! Do you know or can explain how to use OpenCV with C# in Visual Studio?
Thank you! I havent tried it with C# before, but i'll look into it and see if i can figure something out :)
@@NicolaiAI That would be great! I found out that I have to use EMGU CV C# Wrapper. But until now I haven’t tried it out
Great video, thank you very much!!!
Thanks a lot! Glad you liked it
When I do Cmake:Configure, it doesnt show any kits. If I try to scan, none show up. How do I get the vscode to show up?
What about lnk2019 errors occured what is the solution please
Here we need visual studio build tools as well, how you have compiled without them?
What build tools are u thinking about? Have u installed CMake Tools?
@@NicolaiAI
I have already setup this, requirements were different, you have mentioned here, Visual studio(not visual studio code) and c++ development are required.
Yes this video is about visual studio code as the title says
@@NicolaiAI yeah i know but i want to confirm?
@@Tesla_News_Space_X_Musk bro, was the same for me. I needed to installed Visual Studio Community first. Checkout when you elected the compiler, its says "Visual Studio Community". And when you install VSComunnity, select the option for C/C++ developers and then just follow the video.
The video is just amazing, excellent content! Keep it up!
Awesome video, keep up the good work, i did all the steps but i get this when I build the project:
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build "d:/3d reconstruction/opencvtest/build" --config Debug --target all -j 18 --
[build] [ 50%] Building CXX object CMakeFiles/opencvtest.dir/main.cpp.obj
[build] [100%] Linking CXX executable opencvtest.exe
[build] CMakeFiles\opencvtest.dir/objects.a(main.cpp.obj): In function `main':
[build] D:/3d reconstruction/opencvtest/main.cpp:8: undefined reference to `cv::Mat::Mat()'
[build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::imread(std::__cxx11::basic_string const&, int)'
[build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::Mat::operator=(cv::Mat&&)'
[build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::Mat::~Mat()'
[build] D:/3d reconstruction/opencvtest/main.cpp:15: undefined reference to `cv::namedWindow(std::__cxx11::basic_string const&, int)'
[build] D:/3d reconstruction/opencvtest/main.cpp:16: undefined reference to `cv::imshow(std::__cxx11::basic_string const&, cv::_InputArray const&)'
[build] D:/3d reconstruction/opencvtest/main.cpp:17: undefined reference to `cv::waitKey(int)'
[build] D:/3d reconstruction/opencvtest/main.cpp:8: undefined reference to `cv::Mat::~Mat()'
[build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::Mat::~Mat()'
[build] D:/3d reconstruction/opencvtest/main.cpp:8: undefined reference to `cv::Mat::~Mat()'
[build] collect2.exe: error: ld returned 1 exit status
[build] mingw32-make.exe[2]: *** [CMakeFiles\opencvtest.dir\build.make:115: opencvtest.exe] Error 1
[build] mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:838: CMakeFiles/opencvtest.dir/all] Error 2
[build] mingw32-make.exe: *** [Makefile:120: all] Error 2
[build] Build finished with exit code 2
Same problem. Did u find a solution for it?
Same
I know this is crazy late but did you figure out the solution
Hello, I did everything like in the Video, but I get the error:
opencv2/opencv.hpp: no such file or directory gcc
And I dont know what to do, please help
Do u have opencv in ur environmental variables?
@@NicolaiAI I addet the 3 that are shown in the Video
@@immischa4566 then it can only be the cmake configuration
@@NicolaiAI In the Cmake conf at 7:04 I only had the first 3 to choose from, so I selected MIngw bc I usually used it for my projects
I did instaall all the extensions as you showed
I have not tried it with a different compiler but my guess would be that it's supposed to work with mingw
Hi, do you know how remove background to person image with opencv
Your content is so wonderful. But don't you use CLion IDE instead?
Thanks a lot bro! I just prefer vs code over anything because of the look and all the extensions
CMakeLists.txt:2 (project):No CMAKE_C_COMPILER could be found . I am getting this error message how do i fix this?
I am not sure why, but I am unable to find the extensions that you use. I have searched for them; however, none of them show up for me. Does anyone know what I might have done wrong?
Hey thanks a lot. but can u please make a video on how to add the tracking modules? Wld be really helpful
Excelent video! But, I'm sorry, I have an error.
On a minute 10:18 when you write "target_link_libraries( opencv-setup ${OpenCV_LIBS} )", I've an error:
"CMake Error at CMakeLists.txt:12 (target_link_libraries):Cannot specify link libraries for target "opencv-setup" which is not built by this project"
Why? And what I have to do to resolve it?
Thank you very much!
th-cam.com/video/6d4jK0nz918/w-d-xo.html
Unfortunately none of this worked for me. Tried cmake:Quick Start, still getting "unable to determine what CMake generator to use. VS still can't find a compiler. Using latest version of VS. OpenCV and CMake. Totally disappointed especially because all of his other videos have been great.
I tried your method with my laptop, it failed.
I bought a new laptop last week and tried your method again today, it still failed.
Hi, great tutorial it help me a lot to get started. I have a question, when you do CMake: Configure -> create a new file...etc. 7:58 CMake generate CMakelist.txt, main.cpp and some other files files. Is there a way to customize those files? I will like to have those, custom made for me
Same here... No popup, what to do next then?
I hope since then he's learned to put his camera stream somewhere other than over the place he needs to work.
At 7:04 I only have the two first options in the CMake configuration. Do you have an idea how to solve my problem ?
update : You simply need to download Visual Studio C++ as he mentionned..
Great that u figured it out!
@@joehenri1 sorry .I downloaded but i still just have two options.After installing it , you do something after ?
so every time that I want to create an opencv project, I need to create such Cmakelist? is that any method to avoid that?
Nope u would have to do that, but it probably takes 20 seconds when u get used to it. You can just copy paste it from github or something
thanks! i'm looking for codeblocks opencv installation
Can anyone guide ma about "opencv2\face.hpp" i want to include it but i am getting an error "cannot open source file opencv2\face.hpp". No solution found anywhere online. I am using Visual Studio C++ 2022
When after compiling and then running the sample code I get the following error: "Abort trap (core dumped)"
Good Video! It Helped! 👍
Awesome man! Glad I could help
fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' - any idea what's going on here?
Yes u have most likely chosen the wrong architecture for the project/cmake configuration. It depends on what architecture u have installed opencv for but u are most likely looking for x86. Try check in the blue bar at the bottom of vscode
Can I use any compiler other than msv_...
Can we Do this using MinGW g++ and mingw32-make file?
Im not sure how to do that, but it might be possible
bro, nice video. But ur high speed may not be a friendly choice for a EN-specker
No such file or directory detected after build everything
At 7:00 it is saying
No CMakeLists.txt was found
What to do ?
Please help anyone!!
The latest VS code has bug which not allowed to connect to opencv library while debugging , even setup all environment and path, so i had gave up using VS code for coding.
is this true ? Have been trying to install it for a couple of days now and all i got is "no such file or directory"
thanks for the video but i keep getting error
main.cpp:2:31: fatal error: opencv2/highgui.hpp: No such file or directory
#include
^
compilation terminated.
although added the opencv to path
did u solve it?
Thank you very much for your help ^^
Thanks for watching! Really glad that i could help u
jooo hsnr lässt grüßen
For people getting the linking errors ( LNK2019 LNK4272 LNK1120 ), select a different kit, shift+ctrl & P --> "Select a Kit" and choose something different, maybe amd64 and build again after a few seconds.
THANKYOUU
In my case, it was because I was launching it from C/C++ (top right) instead of CMake/Launch from the button at the bottom.
Thank you so much!
You're welcome!
Hey, Thanks for the video.
I did exactly what you showed in the video but I get an error with opencv header files not found:
main.cpp:2:10: fatal error: opencv2/opencv.hpp: No such file or directory
2 | #include
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Thanks for watching! Did u set the environmental variables?
@@NicolaiAI yes, i have set the environment variables.
@@BlacksoulRider Hey, I know it's far fetched cause you have done it ages ago, but did you figure out why this happened? I have the same problem. I would be most grateful.
@@veljkojovanovic2152 Unfortunately, NO, it didn't work in VS code for some reason.
However, I built opencv from source using Cmake and continued using Visual Studio Community.
works! thanks
Awesome man! Happy that you got it to work
Nothing happened when I press the CMake: Configure button. I dont see any architecture options or anything. It just disappear
Same
@@yaroslavprotsenko4116 I figured it out, already. You have to open your folder in VSCode first
Awesome! thanks a lot
Thanks for watching! Glad that it could help u
Hi, I can complie the .cpp file like the video indicates([build] Build finished with exit code 0), but when I run I got following error on the terminal:
[ WARN:0@0.015] global C:\build\master_winpack-build-win64-vc15\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('Resources/test.png'): can't open/read file: check file path/integrity
No image data
(I'm sure the image payh is correct.)
can anybody help, please??
The same problem for me, anybody helping me to solve this problem would be great
It wants me to load a cmake.txt file
I encountered a small problem at 7:04. VS code shows only 3 options:
1.[Scan for kits] Search for compilers on this computer
2.[unspecified] Unspecified (Let Cmake guess what compiler and environment to use)
3. GCC 8.1.0 i686-mngw32 Using compilers: C=C:\......
which one do I select? I am trying perform watermarking on 1080p images using only c.
@@stalinsaravanan3059 apparently 3rd option works. Try that
Hey I had the same problem all day, I resolved the issue by installing Visual Studio 2019 Community. Those three option you have are the compilers you can use however, in the tutorial we see The Coding Lib select the Visual Studio 2019 Community Release. Hopefully that helped be sure to install it, run it and set it up and the other options should populate.
I got this Error please help !!
CMake Error at CMakeLists.txt:7 (find_package):
[cmake] Found package configuration file:
[cmake]
[cmake] C:/DEV/opencv/build/OpenCVConfig.cmake
[cmake]
[cmake] but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
[cmake] NOT FOUND.
Thank you so much
Thanks a lot for watching!
legend
Meanwhile in python: _pip3 install opencv-python_
Your webcam blocks a lot of useful information. I found it really hard to follow what was going on because of this.
should i trust this?
thanks man. that's worked fine for me.
Thanks for watching! Glad that i could help
Hello, thanks for the great videos! I have had issues for 2 days, I can't make it.
So I followed steps like u said, create PATH for env, then configure CMAKE, but
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] Generator
[cmake]
[cmake] Visual Studio 17 2022
[cmake]
[cmake] could not find any instance of Visual Studio.
I found this error, and Idk what to do.
Thank you!
Hello! Tank you very much for this video! i tried to install all components. but i have some failures: Error LNK 2019, LNK 4272 - 7:00 i use the release - X86, fatal error LNK 1120. can you help me? its my first project in Virtual Studio. it would be very helpful if you can explain how i can fix these failures. with best regards stefan
have u managed to fix this?
Could you do a linux version? That would be great!
I'll definitely do that
@@NicolaiAI can you do the linux one with contrib module.set it up in linux with contrib with either clion or vscode
How to install opencv_contrib VS code?
Done it! Cmake
Great that u figured it out!
the first 15 seconds were unintelligible. please slow down.
Not working broo
Do u have visual studio 2019 with c++ development?
@@NicolaiAI I have visual studio code and c++ development extension or c++ ?? I have c++ but I don't have c++ development
@@RegishShrestha try install visual studio 2019 and check off c++ development tool and see if that solves ur problems
@@NicolaiAI thank you .Yeah now it worked
Great! 🙂
This tutorial is unusable for any extensive development with OpenCV and CMake. It's nice it works for You but honestly this is in no way documenting a proper way of OpenCV installation and usage. Especially if You are using any kind of version control.
That's not the purpose of the video. 98% of people watching this video haven't used OpenCV before and for learning purpose.
And to be clear I'm not building OpenCV from source files but using the installed package. Make sure to check the channel out before leaving random comments if u are going to make comments. Ur comment is for no use since i have several videos building OpenCV from source files with different versions and so on.
did everything still get fatal error: opencv2/opencv.hpp: No such file or directory
#include
i have the same issue; did you ever resolve it? if so, how? thanks.
If someone is having this error in WINDOWS10:
[cmake] Could not find a package configuration file provided by "OpenCV" with any
[cmake] of the following names:
[cmake]
[cmake] OpenCVConfig.cmake
[cmake] opencv-config.cmake
What to do:
add to CMakeLists.txt the following:
set(OpenCV_DIR "/opencv/build")
before
include_directories( ${OpenCV_INCLUDE_DIRS} )
Also restart VS code if code is not running
Thanks!
@@NicolaiAI Nothing bro! Thank you for the great videos!
Thanks a lot for the support!
fatal error: opencv2/opencv.hpp: No such file or directory
#include
did u solve
did you solve?
I got a problem, in the command 'find_package( OpenCV REQUIRED )' .
Then OpenCV is not install correctly
Yes, I just fixed it, thanks a lot for these videos
Thanks for watching! Glad that u figured it out
@@elkinguerra8287 Hi, how did you fix this? I reinstalled it from the executable but it didn't seem to work....
@@datisreyhani4641 hi!
My problem was that I hadn't created the environmental variable for OpenCV, when I created it then everything worked fine, the variable that I created was OpenCV_DIR that is the path to the lib directory