Vscode-cpptools: WINDOWS debugger seems not to work

Created on 26 Oct 2016  ·  8Comments  ·  Source: microsoft/vscode-cpptools

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.

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.

debugger

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/

All 8 comments

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
},

That's parts of my launch.json.

]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.

https://blogs.msdn.microsoft.com/vcblog/2016/10/24/building-your-c-application-with-visual-studio-code/

@mazhan465 Is this the same issue as #316 ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jrieken picture jrieken  ·  3Comments

wdc596933938 picture wdc596933938  ·  3Comments

SkyRiderMike picture SkyRiderMike  ·  3Comments

jheinzel picture jheinzel  ·  3Comments

ecbrodie picture ecbrodie  ·  3Comments