Home > OS >  VSCode intellisense for CGAL header includes that have multiples subfolders
VSCode intellisense for CGAL header includes that have multiples subfolders

Time:10-09

I searched a lot (1 week) for correctly setting up intellisence on Visual Studio Code. Nothing works... Can anyone give an advice why CGAL is not found properly? I can build and run code without problems, but coding is really cumbersome with broken intellisence.

If someone use CGAL in VSCode please share you properties file.

I managed to set all the libraries I am using, but CGAL is somehow special. Intellisence is missing for it. I tried even to include dozes of directories of each header include files, but still it is not recognized. Other libraries are found without issues.

My c_cpp_properties.json looks like this:

{
    "configurations": [
        {
            "browse": {
                "databaseFilename": "",
                "limitSymbolsToIncludedHeaders": true
            },
            "includePath": [
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/cdt/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/imgui/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/opengl/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/pipe/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/ply/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/viewer/include/stb/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/cdt/CDT/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/clipper_2/CPP/Clipper2Lib/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/imgui/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/imgui/backends/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glfw/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glad/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glm/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glm/glm/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glm/glm/detail/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glm/glm/ext/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glm/glm/gtc/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glm/glm/gtx/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/glm/glm/simd/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/assimp/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/wood/include/",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/cgal/include/CGAL/", //CGAL/
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/cgal/include/CGAL/**", //CGAL/
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/eigen/Eigen/**",
                "C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/boost/include/boost-1_78/" //boost/
            ],
            "name": "compas_wood_config",
            "intelliSenseMode": "gcc-x64",
            "compilerPath": "C:\\Ninja\\ninja.exe",
            "cStandard": "c17",
            "cppStandard": "c  17",
            "compilerArgs": [
                ""
            ],
            "configurationProvider": "ms-vscode.makefile-tools"
        }
    ],
    "version": 4
}

enter image description here enter image description here

CodePudding user response:

because all your #include <CGAL/.....> start with CGAL use this directory in the c_cpp_properties.json

C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/cgal/include/

Why have you installed the CGAL library IN your build directory?

The build directory should ONLY contain stuff that you can generate, compiled results.

Install the CGAL files in a place like C:/IBOIS57/_Code/Software/CPP/API/CGAL

  • Related