Visual code c++, machine terminal not showing and disappearing - c++

I have problems with the terminal not outputting anything when I run my code, I provided some pictures for guidance. I'm not new to c++ but this is my first time setting up VS code. This is the ; latest version of VS Code. My goal is to have something where I can arbitrarily make code in c++ for practice, and maybe more languages down the road.
Whenever I set "stopAtEntry" to true, the machine terminal will sometimes output, but it's not consistent. And after closing the machine terminal it takes about 17 seconds for it to close. (my computer is new, so is this just a VS code thing?)
When "stopAtEntry" is false, the terminal immediately closes when the program starts.
I'm not sure if I need to adjust this file or even make it. The guy in the tutorial edited it. But it didn't help or worsen the problem. So I might remove it like it was before.
The VS code terminal works fine. It's just the machine terminal that's not working as intended. Oris just simply how compilers work. The only other ones I've tried were Bloodsheed c++ and Net Beans (for Java).
Thank you.

Related

Was GDB listing the code as I stepped through, or was I only dreaming?

Years ago, when I last had call to use GDB to debug a Linux server, I seem to remember seeing a listing of the code that was being executed. Perhaps it was just the current line +/- five lines or so. I think i also remember it redrawing the entire console, every time I executed a command, so that the code listing was always at the top of the screen.
Now that I am once again in need of GDB's assistance, is my memory playing cruel tricks on me? Or does such a mode actually exist?
The documentation I'm finding online just points me at the 'l' command to list code. That looks like it has some potential, but there doesn't seem to be a way to get it to dynamically update as I step/next my way through the code.
If it's significant, I'm running Ubuntu on a dedicated Linux machine, and (since the program uses OpenGL) the actual debugging is going on inside a Weston Compositor terminal window.

c++ program execution in cmd malbehaviour [duplicate]

This question already has an answer here:
Running my C++ code gives me a blank console
(1 answer)
Closed 4 years ago.
Using cmd commands
- g++ hello.cpp -o hello.exe
- hello
compiles hello.cpp and runs the hello.exe program.
Normally, it used to just print 'helloworld' in the cmd window, which takes no time.
However, yesterday it started to behave differently in that after compilation, when the program is first run, another window pops out very briefly (showing 'helloworld', I can see it clearly even though the window vanishes very soon) before 'helloworld' is printed in cmd window (which is seconds later, very slow and annoying!)
The extra window does not pop out for subsequent execution. It only pops out and causes delays during the first run.
//----------------------------------------------------------------
I have completely no idea how to make it behave like it used to, and here are my guesses of what caused it:
I watched porn in goolge chrome incognito window but in developer mode (had to add sci-hub extension in developer mode) and perhaps I got some virus that affected the path somehow. What's more for this guess: my google chrome is starting to crash more frequently than prior to watching porn in developer mode.
Compiler auto-update? But I haven't manually updated the compiler recently. It didn't ask for update too.
Windows update?
Anyone has any idea pls? This is very annoying bcos as quite a beginner in c++ I frequently run tests and have to go through the time delays that I have never experienced (except for programs that need longer time to execute like inefficiently-coded sudoku solver). Of course I can do it with online c++ compiler but I find notepad++ more pleasing than any other mediums.
I made the program run in a crazy 10000000000 for-loop so that I could take a closer look on the popout window.
Found out that it was Avast Cybercapture (cleary written up there) scanning for zero attacks.
Disabled scanning for that directory.
Resolved. Huuray!

Execute Command not working in Geany (Windows 10)

I am really new to programming (actually trying to get this to work for my 1000 level intro C++ class) so I apologize for bad descriptions and lack of terminology.
I am having trouble getting a "Hello World" program to work on Geany. I have followed the instructions here http://wiki.geany.org/howtos/win32/getting-started , pretty much to the letter. My program gets a successful message when I hit compile/build. When I hit execute the terminal pops up but it is blank.
There is a flashing cursor in the spot where I would expect Hello World to be but instead it is blank, and I cannot type anything in the window. From what I've researched I think it may be a similar problem from here How do you make Execute do anything in Geany? but searches on changing the terminal form to work for windows has not yielded any results.
In fact, I have not found much help for Geany on windows at all, so if there is a better set of software to use that is pretty basic I would be interested, I am only really attached to Geany because that is what we will be using in class (on a Linux operating system)
Thanks for the help!
John
Avast Antivirus does, in fact, cause Geany to fail execution of the program. Windows 10 Pro 64-bit using Geany 1.26 full installer with MinGW. I just shut down shields for 10 mins and this allowed the program to execute.
Thanks.

Works when run from Visual C++ but sometimes not standalone

The actual question: what are the differences between running in Visual C++ 2010 (both release and debug mode) and standalone, excluding anything that couldn't cause the problem stated at the bottom of this post?
I have a very specific problem with my program, so I am not going to post the code. If you would like to know details of the problem to gain some understanding, I post them at the bottom. Instead, I ask: what are the differences in running in visual c++ and standalone?
I am using Visual C++ 2010, and my program is using SFML 2.0. It runs fine in studio (I am calling it studio because it is easier to type), but when run standalone on some computers only a bug will occur within the program, to do with movement being delayed but other parts not. I cannot find any links between the computer specs of the users who test it and whether they work or not.
All dlls and such are included (at least, I think they are - the program runs fine, as detailed at the bottom - maybe some users have some framework installed?). On my computer, it works all the time in studio but not standalone. On my netbook, it works, on my older computer, it doesn't. The only project settings I changed with vc++ directories and linker settings.
Problem details:
All the sounds sound slightly different and there is a possible high pitched background noise. Character movement, enemy movement and space bar delay which is supposed to be 0.5 seconds is increased to about 5 seconds but "generating pixels" (an aspect in the game with the arrow keys isn't.
I'm stressing again that it only happens on SOME COMPUTERS, mine included, but always works when run within studio. A number of people have tested the game, and some reported the problem and others different.
[NOT THE MAIN POINT OF THE QUESTION BUT HERE IS AN EXTRA BIT: If you are so willing to help me that you wish to look through the entire source code, it's here: http://dl.dropbox.com/u/53835113/EVERYTHING.zip [note: ignore the massive amount of bugs and memory leaks other than the problem described :P]]
EDIT: THE POINT ISN'T THAT I WANT MY PROGRAM DEBUGGED! That is an optional extra. The question: what are the differences in running in visual c++ and standalone?
More edits: Found that the problem is due to the frame time not being correct. Not sure if this provides some insight.
Thanks to anyone who tries to help me!
GetFrameTime() in SFML was removed in a recent version because it returns the time since last frame rather than the time since last update. As a result, the it may return 0.

Saving debugging state and backwards debugging with Xcode or friends

I am using Xcode in order to debug C++ programs. The main problem for me is that it takes around 10 munutes till the program gets to the point of the program that I need to debug. Then I realize about something inspecting the variables and some other stuff, and modify the code. Then 15 minutes again and so ...
I wonder if there is possible in some way in Xcode or in another IDE or compiler/debugger for C++, to "save" in some way a desired debugging state of the program. So if my compouter crashes or I modify the code and make some mistakes, one can open this saved state instantly and get fast to the point where one left before.
I also wonder if at this moment Xcode can "backwards debugging". GDB can for sure, as for september 2009. Or what do you think is the best IDE to do this.
Thanks a lot
GDB has "backwards debugging" (or more correctly "Reverse Debugging") for a limited number of platforms (list of native supported ones):
i386-linux
amd64-linux
moxie-elf ( http://moxielogic.org/blog/ )
So it is impossible for now to use this functionality on Mac OS X, with Xcode or without it.
Saving of program state in offline is very hard task. It is almost impossible to restore state of file descriptors, network connections, memory state (randomization of layout), even pid.
Such task is related to "Live migration" problem in openvz.
"Edit and Continue" feature from MSVS allow you to continue running after breakpoint with new version of code. It is supported for C#, C++ and Basic.
http://msdn.microsoft.com/en-us/library/esaeyddf(VS.80).aspx