简体   繁体   中英

Debugging C++ on Windows

I'm trying to implement a Suffix Trie to search strings using C++ for a programming assignment. Now I've started coding things with Vim/Ubuntu on a virtual machine (since I run windows), partly because it's encouraged by our lecturer not to use IDEs and compile things manually, and partly because the VM is too slow to run a decent IDE anyway.

But my program has grown quite large and I need to debug things. I've grown quite fond of both Eclipse's and CLion's debuggers in the past, so I decided to copy and paste my workspace to a windows directory, just for debugging.

I'm using C++11 and MinGW as a compiler, and programs run just fine:

程序运行良好

But when I tried to debug the program, I got the message:

克莱恩

So I decided to try debugging in Eclipse instead. This time it sort of worked, but it isn't treating my std::string objects as strings, but rather as just objects with lots of properties in them:

在此处输入图片说明 在此处输入图片说明

This is obviously a problem since I'm dealing a lot with std::string s. Now I've read online that this is related to the whole pretty printers thing I got with CLion, but I haven't been able to find anything which tells me how to get things set up with MinGW. I'd appreciate any advice.

I was trying to figure out the same thing few days back. After Googling for hours and compiling all the stuff into one place, I have created a detailed post which might here. Here is the link: https://dev.to/abhinav1602/how-to-run-vs-code-c-debugger-on-windows-4d3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM