2. 檢視 -> 擴充功能 -> C/C++
3. command+shift+P -> C/Cpp: Edit Configuration (標頭檔路徑產生在c_cpp_properties.json)
4. command+shift+P -> Tasks: Configure Task Runner -> Others (選編譯器跟寫編譯script)
5. command+shift+P -> Debug Open launch.json -> C++ (GDB/LLDB)
6. "program": "enter program name, for example ${workspaceRoot}/a.out",
修改成"program": "${workspaceRoot}/a.out",
7. Debug
參考資料:
https://code.visualstudio.com/docs/languages/cpp
ps.
如果在main function有char** argv
要在launch.json文件裡"args": []的中括號裡輸入值
沒有留言:
張貼留言