代码补全及函数跳转
打开一个工程会看到很多的波浪线,提示未定义标识符,以及当点击函数名时,不会发生跳转;这个时候就需要我们在代码工程中的c_cpp_properties.json
进行配置.
问题原因:
部分标识符不是定义在头文件中,而是在编译时通过python加入的。
解决办法:
在.vscode\c_cpp_properties.json中的"configurations"配置节下面添加:
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
即可解决问题,如下图所示,已没有下划线提示了。