When I click debug only this message:
You may only use the C/C++ Extension for Visual Studio Code with Visual Studio
Code, Visual Studio or Xamarin Studio software to help you develop and test your
and then I couldn't do anything.The process seem not go into main funtion.Even My code have error,debugger still not any change.
1) Can you check in the debugger output window and see if symbols are loaded for your application?
2) Was your application compiled with the Visual C++ debugger or with GCC? If Visual C++, you are using the correct debugger. If gcc, then you need to use the gdb/lldb options.
Hope that helps
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (Windows)",
"type": "cppvsdbg",
"request": "launch",
"program": "${file}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false
},
]And I can't find anything output except:
“When I click debug only this message:
You may only use the C/C++ Extension for Visual Studio Code with Visual Studio
Code, Visual Studio or Xamarin Studio software to help you develop and test your
applications.”
What is ${file}? Can you please try putting in the path to the program instead? ${WorkspaceRoot} is the path to your open folder in vscode. Generally, we see that the most.
${file} is full path of the current file.And if "program": "${workspaceRoot}/main.c",the result is the same as besides.
This is because C and C++ are compiled as opposed to interpreted. You need to compile your code first, and then point the program field to the output of compilation (.exe file). For windows, that would mean using the standalone C++ tools (http://landinghub.visualstudio.com/visual-cpp-build-tools). You can also use a task.json file can also be created that can compile the code when you hit F5.
That said, there is a bug here that the extension is not erroring out when this happens.
It semms rights.But how should I config my task.json.That seems mean I must install MSBuild?
Mazhan, you can take a look at this blog which talks at length about how to build your C++ code inside Visual Studio Code, hope that helps.
@mazhan465 Is this the same issue as #316 ?
Most helpful comment
Mazhan, you can take a look at this blog which talks at length about how to build your C++ code inside Visual Studio Code, hope that helps.
https://blogs.msdn.microsoft.com/vcblog/2016/10/24/building-your-c-application-with-visual-studio-code/