Search code examples
cvisual-studio-codeopenmp

VSCode autocomplete for OpenMP


Is there way to get the autocomplete functions from OpenMp for 'c' files inside VSCode.

I'm currently using

#include <omp.h> 

But this shows a red-underline with the error that imports are not found. Using the -fopenmp with gcc compiles my executable, by the way.


Solution

  • To get auto-completions from any Header File:

    You need to its path to option "C_Cpp.default.includePath" of the C/C++ extension on VScode. (This would only work for the microsoft extension)

    You could search for header using: find /usr -name omp.h and then add the appropriate path inside your Settings.json

    "C_Cpp.default.includePath": [
        "/usr/lib/gcc/x86_64-linux-gnu/7/include/",
    ],