alicevision / CCTag

Detection of CCTag markers made up of concentric circles.

Home Page:https://cctag.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VS Code is giving error while running main.cp file

Akumar201 opened this issue · comments

Describe the problem
Hello I was running the main.cpp in CCTag/src/appplications/detection , however it's running fine with the command ./Linux-x86_64/detection -n 3 -i sample/01.png , however it's throwing an error when I am working on main.cpp file using VScode. I want to write my own script so that I can use it in my software.

Screenshots
Screenshot from 2022-09-21 09-21-12

Desktop (please complete the following and other pertinent information):
I am using Ubuntu 20.04

Make sure you have the CMake Tools for VS Code installed and that you correctly imported the project
https://code.visualstudio.com/docs/cpp/cmake-linux

Hello, I check I am currently using cmake version 3.16.3 , can you please elaborate what you mean by saying "correctly imported the project"

I was referring to the VS Code add-on "CMake Tools for VS Code" from the link. You need to have that installed in VS Code for VS Code to be able to import the cmake project and then compile it.

Greetings, I have CMake Tools for VS Code however , it is still giving an error
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/akumar/c++/new_tag/CCTag/src/applications/detection/main.cpp).C/C++(1696)

I never used VS Code but I guess that when you configure the project you have to provide the paths where to find the libraries:
https://code.visualstudio.com/docs/cpp/cmake-linux#_cmake-configure

It is the equivalent of what you would do at command line
https://cctag.readthedocs.io/en/latest/install/install.html#cmake-configuration
you have to tell where to find opencv adding e.g. -DOpenCV_DIR=path/to/opencv/install/share/OpenCV/ to tell where the OpenCVConfig.cmake file can be found and so on.

commented

This is a classic error while using C++ with VS Code when cloning any library from Github that can be resolved by creating a CMakeLists.txt and configure the include paths.

I am closing this issue as it has been solved. If the problem persists, please comment and the issue will be reopened if appropriate.