-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when i use vscode,if i use <vector> ,i can't debug the program #1372
Comments
@dreamtomb Are you saying that if you remove |
@pieandcakes thank you for your reply。 |
can you see if compilation generated an error? |
Also, which version of mingw are you using? |
@pieandcakes sorry,what should i do for your first question? |
@dreamtomb can you see if you can get a newer version of MinGW?
|
@pieandcakes sorry,this time i update the mingw,and it didn't help. |
After you update, did you recompile? |
@pieandcakes it shows this: ERROR: During startup program exited with code 0xc0000139. |
I see Searching online, it shows that gdb can't find the entrypoint of some library code which seems to be an issue where your compiler doesn't match your debugger. If you are using MinGW's gdb to compile, you need to make 100% sure you are also using the same g++ to compile your code, else it looks like you get this message. |
@pieandcakes sorry,i am a beginner,and i just tried a simple loop,and i find that it can run and debug.so what should i do to make my gdb and g++ same? |
Did you recompile after you updated MinGW using specifically the g++ that is in the MinGW toolset? Provide the full path to g++ when you are compiling. Can you make sure you can run the app from the command line after you have done that and make sure it will run? Then try again. |
Thank you for your help. |
Did that work? |
@pieandcakes yes,it finally works.Thank you very much. |
I'm having a similar issue to the one reported in this thread, but not only with vector, but also with string or map for example. I've made sure that I'm compiling and debugging g++ and gdb of the same mingw version, but the program would still not debug whenever I try to use one of these standard libraries... any advice? tasks.json: { launch.json: { |
If anyone is still searching for a solution, follow this guide. It solved all debugging problems for me. |
For me creating a new workspace worked somehow. |
hello,when i use vscode,if i use vector ,i can't debug the program .
i use windows 10,
i use vscode 1.19.1,c/c++0.14.5,
here is my launch.json:
{ "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${file}.exe", "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "C:/MinGW/bin/gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "task1" } ] }
and here is my tasks.json:
{ "version": "2.0.0", "tasks": [ { "label": "task1", "type": "shell", "command": "g++", "args": [ "-g","-Wall","-std=c++11","${file}","-o","${file}.exe" ], "group": { "kind": "build", "isDefault": true } } ] }
and here is my program:
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> v; for(int i=0;i<10;i++){ v.push_back(i); } for(int i=0;i<10;i++){ cout<<v.at(i)<<endl; } system("pause"); }
then only when i use vector and press F5,i can't debug.
what should i do?thank you very much!
The text was updated successfully, but these errors were encountered: