我搜索了很多(1 周)以在 Visual Studio Code 上正確設定智能。沒有任何效果......誰能給一個建議,為什么沒有正確找到CGAL?我可以毫無問題地構建和運行代碼,但編碼真的很麻煩,智能受損。
如果有人在 VSCode 中使用 CGAL,請分享您的屬性檔案。
我設法設定了我正在使用的所有庫,但 CGAL 有點特別。它缺少智能。我什至嘗試包含每個頭包含檔案的數十個目錄,但仍然無法識別。發現其他庫沒有問題。
我的 c_cpp_properties.json 看起來像這樣:
{
"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
}

uj5u.com熱心網友回復:
因為你所有的#include <CGAL/.....>開始都CGAL使用這個目錄c_cpp_properties.json
C:/IBOIS57/_Code/Software/CPP/CMAKE/super_build/compas_wood/build/install/cgal/include/
為什么在構建目錄中安裝了CGAL庫?
構建目錄應該只包含你可以生成的東西,編譯結果。
將 CGAL 檔案安裝在類似的地方C:/IBOIS57/_Code/Software/CPP/API/CGAL
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/511323.html
標籤:C 视觉工作室代码
