1、修改c_cpp_properties.json文件
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/build/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
2、修改launch.json文件
{
"version": "0.2.0",
"configurations": [
{
"name": "ns3 - build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/scratch/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "LD_LIBRARY_PATH",
"value": "${workspaceFolder}ildb/"
}
],
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: NS3 cpp build active file",
"miDebuggerPath":"/usr/bin/gdb",
}
]
}
3、修改task.json文件
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
// "label": "C/C++: cpp build active file",
"label": "C/C++: NS3 cpp build active file",
"command": "./ns3",
"args": [],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind":"build",
"isDefault": true
},
"detail": "compiler:/usr/bin/cpp"
}
]
}
4、在输入sudo su 命令,打开root权限 ,设置动态链接库
在build文件夹下输入cp lib/* /lib命令,设置动态链接库