如何解決vscode檢測到#include錯誤
- 終端機輸入gcc -v -E -x c-
- 找到 "#include <...> search starts here:"的下面是要include的路徑
- 打開vscode按ctrl + shift + p。 搜索c /c ++:Edit Configurations(JSON),然後打開會出現後面這個檔案,/home/user/Project/tunnel/niceTunnel/.vscode/c_cpp_properties.json
- 將滿剛才打開的路徑貼到這裡的“ IncludePath”
- 如果還是有錯誤訊息,在剛才加入的路徑最後面加上"/**",會自動搜索該目錄下的子目錄
沒有留言:
張貼留言