Sublime Forum

Sublime cannot autocomplete header files and opencv functions

#1

Hi! I am rather new to sublime and I hope to get autocomplete for my project. I have used EasyClangComplete package to autocomplete the functions in C++ STL and it works. However, I still got some problems when I tried to get autocomplete for header files and functions in OpenCV, which I need for my project. Please see the attached picture.

  1. For the header, I have to use “…/include/Solution.hpp” to remove the compile error in sublime. When I use “Solution.hpp”, I get a bunch of “undeclared identifier” errors.

  2. Also, I need to use functions in OpenCV. However, I cannot get any popup/autocomplete when I typed “img.”. The autocomplete is not working.

What I did for EasyClangComplete is adding path to include folder and OpenCV:

"common_flags" : [
    // some example includes
    "-I/usr/include",
    "-I/usr/local/include",
    "-I$project_base_path/src",
    // this is needed to include the correct headers for clang
    "-I/usr/lib/clang/$clang_version/include",
    // For simple projects, you can add a folder where your current file is
    "-I$file_path",

    "-I/~/Documents/Projects/Practice/Project0/include",
    "-I/usr/local/include/opencv4/opencv2",
  ],

But it seems not working. I’m not sure what is the correct way to do this and how I can get the autocomplete for headers and OpenCV. Any help is appreciated!

Thanks!

0 Likes