Step-by-Step Guide: Installing OpenCV C++ and Setting It Up in Visual Studio Code with CMake

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 พ.ย. 2024

ความคิดเห็น • 227

  • @FliBaleon
    @FliBaleon ปีที่แล้ว +61

    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

    • @MrSoandSoPlaysMC
      @MrSoandSoPlaysMC ปีที่แล้ว +2

      You are a godsend ... I was wracking my brains for the last 10 minutes. "Like I'm sure I followed the video properly" 😅

    • @mahmoodalikhan2456
      @mahmoodalikhan2456 6 หลายเดือนก่อน +1

      It worked thank you so much

    • @marwa1698
      @marwa1698 6 หลายเดือนก่อน +1

      Thank you

    • @deSloleye
      @deSloleye 6 หลายเดือนก่อน

      Thank you!

    • @kin_1997
      @kin_1997 5 หลายเดือนก่อน

      wow thank you very much!

  • @kin_1997
    @kin_1997 5 หลายเดือนก่อน +8

    holy hell the setup is brutal

  • @AvHoCaDo
    @AvHoCaDo ปีที่แล้ว +7

    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.

  • @brandonsamuelcruzsilva7626
    @brandonsamuelcruzsilva7626 8 หลายเดือนก่อน +2

    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.

  • @andrewjawney1
    @andrewjawney1 5 หลายเดือนก่อน +2

    Finally! a tutorial that actually worked for me... Thank you Soooooo much for this!

    • @NicolaiAI
      @NicolaiAI  5 หลายเดือนก่อน

      Thanks man! Glad it helped

  • @Anime-be4ru
    @Anime-be4ru 2 ปีที่แล้ว +6

    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!

    • @szhavel
      @szhavel ปีที่แล้ว +4

      It helps me (write before find_packages command) set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /opencv/build/x64/vc15/lib/)

  • @danecchio6621
    @danecchio6621 2 ปีที่แล้ว +4

    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

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว

      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.

  • @samsonmoturi7731
    @samsonmoturi7731 4 หลายเดือนก่อน +4

    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

    • @Divyansh-ll1ps
      @Divyansh-ll1ps 4 หลายเดือนก่อน

      What is very button?? I couldn’t find that

  • @aviraj6554
    @aviraj6554 2 ปีที่แล้ว +3

    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?

  • @aguycalledSilas
    @aguycalledSilas 2 ปีที่แล้ว +2

    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.

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว

      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

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว

      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

  • @ComputerScienceSimplified
    @ComputerScienceSimplified 3 ปีที่แล้ว +14

    Awesome video, keep up the incredible work! :)

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +1

      Thank you very much! It really helps me to keep going :)

  • @scottiemurrell5139
    @scottiemurrell5139 ปีที่แล้ว +4

    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

    • @surajpatel2717
      @surajpatel2717 ปีที่แล้ว +2

      were you able to solve it? did you get the error after the build? or even before you built it?

  • @MirakXfire
    @MirakXfire 3 ปีที่แล้ว +5

    nice video
    honestly compared to visual studio integration it s simpler using cmake

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +2

      Thank you! Yes its way simpler to set up in vscode and for smaller projects. I'll still prefer visual studio for larger projects

  • @Phantom-el6oe
    @Phantom-el6oe ปีที่แล้ว +3

    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.

  • @genayadelaide3157
    @genayadelaide3157 ปีที่แล้ว

    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.

  • @andrew48dhs
    @andrew48dhs ปีที่แล้ว +3

    Would you consider remaking this video for the most recent versions of windows, opencv, and vscode?

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Yeah I should def do that Andrew! Thanks for the tip

  • @luthfiaminulloh8177
    @luthfiaminulloh8177 2 ปีที่แล้ว +2

    why do I get an error while using GCC compiler while following this tutorial, should I install and use Visual Studio Community compiler?

  • @teoextreme
    @teoextreme ปีที่แล้ว +1

    7:23 - Your webcam is blocking the part of the screen, I can't see what you clicked on there. Help please?

  • @balveersingh3051
    @balveersingh3051 ปีที่แล้ว +2

    Day 1 done

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว +1

      Cool man! Thats commitment

  • @songoku-lo7il
    @songoku-lo7il 3 ปีที่แล้ว +4

    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

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      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

    • @songoku-lo7il
      @songoku-lo7il 3 ปีที่แล้ว +1

      @@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

    • @oguzhanbaser1389
      @oguzhanbaser1389 2 ปีที่แล้ว

      ​@@songoku-lo7il you may forget building the project as well. I.o.w. if you run without building you get this error as well.

    • @veljkojovanovic2152
      @veljkojovanovic2152 2 ปีที่แล้ว +2

      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?

  • @LuizAntonio_Gameplay
    @LuizAntonio_Gameplay 2 ปีที่แล้ว +1

    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.

  • @mihirsavla3233
    @mihirsavla3233 3 ปีที่แล้ว +2

    CMake was unable to find a build program corresponding to "MinGW Makefiles".

  • @midomarusama
    @midomarusama 2 ปีที่แล้ว +3

    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.

    • @dionfrancois5649
      @dionfrancois5649 2 ปีที่แล้ว

      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)

    • @cameronkerr6258
      @cameronkerr6258 ปีที่แล้ว

      @@dionfrancois5649 I have the same bug, do you know how to select an older version of cmake tools?

    • @sebastianlarsen6713
      @sebastianlarsen6713 ปีที่แล้ว

      @@cameronkerr6258 you can also swap to the visual studio community compiler instead of minGW if on windows

  • @snim9515
    @snim9515 2 ปีที่แล้ว +2

    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.

    • @eskanderassaf2844
      @eskanderassaf2844 ปีที่แล้ว

      Please..if you fixed it tell me the way....I got just the same error

  • @adsz8266
    @adsz8266 11 หลายเดือนก่อน +1

    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?

    • @NicolaiAI
      @NicolaiAI  11 หลายเดือนก่อน +1

      You will have to install visual studio to build on windows

  • @hiteshvaidya3331
    @hiteshvaidya3331 2 ปีที่แล้ว +2

    you need to zoom in to the screen because the file names on your file explorer appear too small in size

  • @walleve_
    @walleve_ ปีที่แล้ว +6

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

    • @JoceAC
      @JoceAC ปีที่แล้ว

      so were you able to make it work with mingiw as a compiler or did you had to change to visual studio for compiling?

    • @sarveshprajapati3878
      @sarveshprajapati3878 ปีที่แล้ว

      Yes lol, was trying to build pthread and what not from source, easiest thing to do is just download c++ from vs code.

  • @protozilla
    @protozilla หลายเดือนก่อน +1

    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?

    • @v0id683
      @v0id683 29 วันที่ผ่านมา

      Same here

  • @HungBui-gu2wk
    @HungBui-gu2wk 3 ปีที่แล้ว +2

    Thenkiu so much. From Vietnam with love

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Thank you! Glad that u like it

  • @g2h5j3
    @g2h5j3 2 ปีที่แล้ว +2

    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

    • @D4wGr1
      @D4wGr1 ปีที่แล้ว

      Same 🫤

  • @datisreyhani4641
    @datisreyhani4641 3 ปีที่แล้ว +3

    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!

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +1

      Make sure u have everything in release mode and have the path variable as i have in the description

    • @datisreyhani4641
      @datisreyhani4641 3 ปีที่แล้ว +2

      @@NicolaiAI I have the environment variables exactly as you did in the video, but what do you mean by release mode? Thx

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +1

      @@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

    • @datisreyhani4641
      @datisreyhani4641 3 ปีที่แล้ว +2

      @@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!

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +1

      Great that u figured it out! Enjoy

  • @ALUNGAJoshuaJerry
    @ALUNGAJoshuaJerry 10 หลายเดือนก่อน

    Can you do a video about installing the opencv-contrib modules when you already have the opencv core installed

  • @JUANjuan871ju
    @JUANjuan871ju 19 วันที่ผ่านมา

    CMake Error at CMakeLists.txt:2 (project):Running
    'nmake' '-?'
    failed with:
    no such file or directory
    can someone help me with this

  • @samueldipo6790
    @samueldipo6790 ปีที่แล้ว +1

    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?

  • @amazlin8271
    @amazlin8271 ปีที่แล้ว

    What is the role of installing CMAKE software?
    Could i work with vscode and opencv without installing cMake?

  • @inipraiseadeniyi6848
    @inipraiseadeniyi6848 2 ปีที่แล้ว

    same process for mac? or can you please do one for mac... been struggling with the installation and set up for a while.

  • @SharadaNaik-qw2ht
    @SharadaNaik-qw2ht ปีที่แล้ว +1

    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

    • @jochenderycke9211
      @jochenderycke9211 ปีที่แล้ว

      I have the same issue, did you find a solution?

  • @andrewflint6089
    @andrewflint6089 3 ปีที่แล้ว +3

    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
      @NicolaiAI  3 ปีที่แล้ว +1

      Do u have visual studio 2019 with c++ development tool installed?

    • @andrewflint6089
      @andrewflint6089 3 ปีที่แล้ว +1

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

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Thanks for watching! Glad that i can help

  • @MrPusmucans
    @MrPusmucans ปีที่แล้ว

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

    • @yuconglyu6230
      @yuconglyu6230 ปีที่แล้ว

      Ctrl+Shift+P, CMake:Quick start,Then can create executable project.

  • @NicolaiAI
    @NicolaiAI  ปีที่แล้ว +1

    Join My AI Career Program
    👉 www.nicolai-nielsen.com/aicareer
    Enroll in My School and Technical Courses
    👉 www.nicos-school.com

  • @ericbighead8953
    @ericbighead8953 3 ปีที่แล้ว +3

    Great video! Do you know or can explain how to use OpenCV with C# in Visual Studio?

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +1

      Thank you! I havent tried it with C# before, but i'll look into it and see if i can figure something out :)

    • @ericbighead8953
      @ericbighead8953 3 ปีที่แล้ว +1

      @@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

  • @antonkisel4732
    @antonkisel4732 4 หลายเดือนก่อน +1

    Great video, thank you very much!!!

    • @NicolaiAI
      @NicolaiAI  4 หลายเดือนก่อน

      Thanks a lot! Glad you liked it

  • @barbearian3054
    @barbearian3054 ปีที่แล้ว

    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?

  • @nournour-mc4xh
    @nournour-mc4xh 3 ปีที่แล้ว +2

    What about lnk2019 errors occured what is the solution please

  • @Tesla_News_Space_X_Musk
    @Tesla_News_Space_X_Musk 3 ปีที่แล้ว +3

    Here we need visual studio build tools as well, how you have compiled without them?

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      What build tools are u thinking about? Have u installed CMake Tools?

    • @Tesla_News_Space_X_Musk
      @Tesla_News_Space_X_Musk 3 ปีที่แล้ว

      @@NicolaiAI
      I have already setup this, requirements were different, you have mentioned here, Visual studio(not visual studio code) and c++ development are required.

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Yes this video is about visual studio code as the title says

    • @Tesla_News_Space_X_Musk
      @Tesla_News_Space_X_Musk 3 ปีที่แล้ว

      @@NicolaiAI yeah i know but i want to confirm?

    • @luisaraya2676
      @luisaraya2676 3 ปีที่แล้ว

      @@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!

  • @alihamdy3550
    @alihamdy3550 2 ปีที่แล้ว +6

    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

    • @tanmaythaker2905
      @tanmaythaker2905 2 ปีที่แล้ว +1

      Same problem. Did u find a solution for it?

    • @4790kusi
      @4790kusi 2 ปีที่แล้ว

      Same

    • @applhau9876
      @applhau9876 10 หลายเดือนก่อน

      I know this is crazy late but did you figure out the solution

  • @immischa4566
    @immischa4566 3 ปีที่แล้ว +2

    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
      @NicolaiAI  3 ปีที่แล้ว

      Do u have opencv in ur environmental variables?

    • @immischa4566
      @immischa4566 3 ปีที่แล้ว

      @@NicolaiAI I addet the 3 that are shown in the Video

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      @@immischa4566 then it can only be the cmake configuration

    • @immischa4566
      @immischa4566 3 ปีที่แล้ว

      @@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

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      I have not tried it with a different compiler but my guess would be that it's supposed to work with mingw

  • @ecgnetwork
    @ecgnetwork 7 หลายเดือนก่อน

    Hi, do you know how remove background to person image with opencv

  • @aliksargsyan2782
    @aliksargsyan2782 ปีที่แล้ว +1

    Your content is so wonderful. But don't you use CLion IDE instead?

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Thanks a lot bro! I just prefer vs code over anything because of the look and all the extensions

  • @saltygamer8435
    @saltygamer8435 ปีที่แล้ว

    CMakeLists.txt:2 (project):No CMAKE_C_COMPILER could be found . I am getting this error message how do i fix this?

  • @ryangippner4681
    @ryangippner4681 2 ปีที่แล้ว

    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?

  • @vaishnaviseshadri7128
    @vaishnaviseshadri7128 2 ปีที่แล้ว

    Hey thanks a lot. but can u please make a video on how to add the tracking modules? Wld be really helpful

  • @giada6242
    @giada6242 2 ปีที่แล้ว +2

    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!

    • @minteligencia
      @minteligencia 2 ปีที่แล้ว

      th-cam.com/video/6d4jK0nz918/w-d-xo.html

  • @pademo57
    @pademo57 9 หลายเดือนก่อน

    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.

  • @MrPapirruki
    @MrPapirruki 2 ปีที่แล้ว +1

    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

    • @andraspoljak
      @andraspoljak ปีที่แล้ว

      Same here... No popup, what to do next then?

  • @deSloleye
    @deSloleye 6 หลายเดือนก่อน

    I hope since then he's learned to put his camera stream somewhere other than over the place he needs to work.

  • @joehenri1
    @joehenri1 3 ปีที่แล้ว +1

    At 7:04 I only have the two first options in the CMake configuration. Do you have an idea how to solve my problem ?

    • @joehenri1
      @joehenri1 3 ปีที่แล้ว +2

      update : You simply need to download Visual Studio C++ as he mentionned..

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Great that u figured it out!

    • @hoangvuviet5923
      @hoangvuviet5923 3 ปีที่แล้ว

      @@joehenri1 sorry .I downloaded but i still just have two options.After installing it , you do something after ?

  • @burgenkinger2856
    @burgenkinger2856 3 ปีที่แล้ว +1

    so every time that I want to create an opencv project, I need to create such Cmakelist? is that any method to avoid that?

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      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

  • @kabadar
    @kabadar ปีที่แล้ว

    thanks! i'm looking for codeblocks opencv installation

  • @awabsial7560
    @awabsial7560 10 หลายเดือนก่อน

    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

  • @ShopperPlug
    @ShopperPlug 2 ปีที่แล้ว

    When after compiling and then running the sample code I get the following error: "Abort trap (core dumped)"

  • @soulaygaming9937
    @soulaygaming9937 ปีที่แล้ว +1

    Good Video! It Helped! 👍

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Awesome man! Glad I could help

  • @samjordan5006
    @samjordan5006 3 ปีที่แล้ว +1

    fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' - any idea what's going on here?

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +1

      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

  • @learntocode5464
    @learntocode5464 3 ปีที่แล้ว

    Can I use any compiler other than msv_...

  • @jenowin7269
    @jenowin7269 3 ปีที่แล้ว +1

    Can we Do this using MinGW g++ and mingw32-make file?

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Im not sure how to do that, but it might be possible

  • @邹凯-g3j
    @邹凯-g3j 2 ปีที่แล้ว

    bro, nice video. But ur high speed may not be a friendly choice for a EN-specker

  • @pipinstallpycaret4056
    @pipinstallpycaret4056 หลายเดือนก่อน

    No such file or directory detected after build everything

  • @sushilkrsoni2796
    @sushilkrsoni2796 ปีที่แล้ว

    At 7:00 it is saying
    No CMakeLists.txt was found
    What to do ?
    Please help anyone!!

  • @Javier_Chang
    @Javier_Chang ปีที่แล้ว

    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.

    • @tuanphongha8952
      @tuanphongha8952 7 หลายเดือนก่อน

      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"

  • @shadyzahran3330
    @shadyzahran3330 ปีที่แล้ว

    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

    • @phuho6583
      @phuho6583 8 หลายเดือนก่อน

      did u solve it?

  • @dralliteration
    @dralliteration 3 ปีที่แล้ว +2

    Thank you very much for your help ^^

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Thanks for watching! Really glad that i could help u

    • @alex15558
      @alex15558 3 ปีที่แล้ว +1

      jooo hsnr lässt grüßen

  • @SweAwesome
    @SweAwesome ปีที่แล้ว +2

    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.

    • @minwoohwang8751
      @minwoohwang8751 ปีที่แล้ว +1

      THANKYOUU

    • @chrisguy6301
      @chrisguy6301 ปีที่แล้ว +1

      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.

  • @spaceflight2608
    @spaceflight2608 ปีที่แล้ว +1

    Thank you so much!

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      You're welcome!

  • @BlacksoulRider
    @BlacksoulRider 2 ปีที่แล้ว +1

    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.

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว

      Thanks for watching! Did u set the environmental variables?

    • @BlacksoulRider
      @BlacksoulRider 2 ปีที่แล้ว

      @@NicolaiAI yes, i have set the environment variables.

    • @veljkojovanovic2152
      @veljkojovanovic2152 2 ปีที่แล้ว

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

    • @BlacksoulRider
      @BlacksoulRider 2 ปีที่แล้ว

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

  • @hytryi_huy
    @hytryi_huy 11 หลายเดือนก่อน +1

    works! thanks

    • @NicolaiAI
      @NicolaiAI  11 หลายเดือนก่อน

      Awesome man! Happy that you got it to work

  • @minhtrio1785
    @minhtrio1785 2 ปีที่แล้ว

    Nothing happened when I press the CMake: Configure button. I dont see any architecture options or anything. It just disappear

    • @yaroslavprotsenko4116
      @yaroslavprotsenko4116 2 ปีที่แล้ว +1

      Same

    • @minhtrio1785
      @minhtrio1785 2 ปีที่แล้ว

      @@yaroslavprotsenko4116 I figured it out, already. You have to open your folder in VSCode first

  • @TarunKrishnanextra
    @TarunKrishnanextra 2 ปีที่แล้ว +1

    Awesome! thanks a lot

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว

      Thanks for watching! Glad that it could help u

  • @M1122-s3g
    @M1122-s3g 2 ปีที่แล้ว

    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??

    • @dharanimohan2849
      @dharanimohan2849 2 ปีที่แล้ว

      The same problem for me, anybody helping me to solve this problem would be great

  • @emreozbek6770
    @emreozbek6770 11 หลายเดือนก่อน

    It wants me to load a cmake.txt file

  • @devanshudwivedi5875
    @devanshudwivedi5875 3 ปีที่แล้ว +2

    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.

    • @devanshudwivedi5875
      @devanshudwivedi5875 3 ปีที่แล้ว

      @@stalinsaravanan3059 apparently 3rd option works. Try that

    • @TheKidHD
      @TheKidHD 3 ปีที่แล้ว

      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.

  • @murataavcu
    @murataavcu 2 ปีที่แล้ว

    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.

  • @Nuvenss
    @Nuvenss 2 ปีที่แล้ว +1

    Thank you so much

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว +1

      Thanks a lot for watching!

  • @Taha-yd4gp
    @Taha-yd4gp 2 ปีที่แล้ว +1

    legend

  • @h0vaK
    @h0vaK 6 หลายเดือนก่อน

    Meanwhile in python: _pip3 install opencv-python_

  • @pjwetherell9414
    @pjwetherell9414 2 ปีที่แล้ว

    Your webcam blocks a lot of useful information. I found it really hard to follow what was going on because of this.

  • @lalithsasubilli8103
    @lalithsasubilli8103 2 ปีที่แล้ว

    should i trust this?

  • @matheusribeiro2739
    @matheusribeiro2739 2 ปีที่แล้ว +1

    thanks man. that's worked fine for me.

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว

      Thanks for watching! Glad that i could help

  • @michaelch3722
    @michaelch3722 2 ปีที่แล้ว

    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!

  • @Stefan-qs2tq
    @Stefan-qs2tq 2 ปีที่แล้ว

    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

    • @prttyflvck0
      @prttyflvck0 ปีที่แล้ว

      have u managed to fix this?

  • @stellamn
    @stellamn 3 ปีที่แล้ว +1

    Could you do a linux version? That would be great!

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +2

      I'll definitely do that

    • @saranh1687
      @saranh1687 2 ปีที่แล้ว

      @@NicolaiAI can you do the linux one with contrib module.set it up in linux with contrib with either clion or vscode

  • @hammerhaj1
    @hammerhaj1 3 ปีที่แล้ว +1

    How to install opencv_contrib VS code?

    • @hammerhaj1
      @hammerhaj1 3 ปีที่แล้ว

      Done it! Cmake

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Great that u figured it out!

  • @crackwitz
    @crackwitz 9 หลายเดือนก่อน

    the first 15 seconds were unintelligible. please slow down.

  • @RegishShrestha
    @RegishShrestha 3 ปีที่แล้ว +2

    Not working broo

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Do u have visual studio 2019 with c++ development?

    • @RegishShrestha
      @RegishShrestha 3 ปีที่แล้ว

      @@NicolaiAI I have visual studio code and c++ development extension or c++ ?? I have c++ but I don't have c++ development

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      @@RegishShrestha try install visual studio 2019 and check off c++ development tool and see if that solves ur problems

    • @RegishShrestha
      @RegishShrestha 3 ปีที่แล้ว +1

      @@NicolaiAI thank you .Yeah now it worked

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Great! 🙂

  • @Kaszanas
    @Kaszanas 3 ปีที่แล้ว

    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.

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      That's not the purpose of the video. 98% of people watching this video haven't used OpenCV before and for learning purpose.

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      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.

  • @applejuice5785
    @applejuice5785 ปีที่แล้ว +1

    did everything still get fatal error: opencv2/opencv.hpp: No such file or directory
    #include

    • @xAllstar249
      @xAllstar249 7 หลายเดือนก่อน +1

      i have the same issue; did you ever resolve it? if so, how? thanks.

  • @king_bisha4841
    @king_bisha4841 ปีที่แล้ว

    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} )

    • @king_bisha4841
      @king_bisha4841 ปีที่แล้ว +1

      Also restart VS code if code is not running

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Thanks!

    • @king_bisha4841
      @king_bisha4841 ปีที่แล้ว +1

      @@NicolaiAI Nothing bro! Thank you for the great videos!

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Thanks a lot for the support!

  • @godse54
    @godse54 2 ปีที่แล้ว

    fatal error: opencv2/opencv.hpp: No such file or directory
    #include

  • @elkinguerra8287
    @elkinguerra8287 3 ปีที่แล้ว +1

    I got a problem, in the command 'find_package( OpenCV REQUIRED )' .

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Then OpenCV is not install correctly

    • @elkinguerra8287
      @elkinguerra8287 3 ปีที่แล้ว +1

      Yes, I just fixed it, thanks a lot for these videos

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Thanks for watching! Glad that u figured it out

    • @datisreyhani4641
      @datisreyhani4641 3 ปีที่แล้ว

      @@elkinguerra8287 Hi, how did you fix this? I reinstalled it from the executable but it didn't seem to work....

    • @elkinguerra8287
      @elkinguerra8287 3 ปีที่แล้ว

      @@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