How to run app from VC++ without debug? - c++

I'm trying to learn to love Visual C++ 2010 Express, but it is difficult! I've just created a "Hello world" console app and compiled it - no problems. I now want to run it. It seems the only option open to me is to run it in the debugger - there is a "Run" button on the toolbar but it is disabled. I don't want to debug it - I really don't like debuggers! Is there any way of just running the app from inside the VS IDE?

If you can't see the "Start Without Debugging" command in the toolbar, go to "Tools -> Settings -> Expert Settings". Basic Settings hides lots of stuff you probably want to see.
Professional version of VC2010 doesn't seem to have this switch.

Open the Tools menu
Go to Customize
Switch to the Commands tab
Select the Debug category
Drag the "Start Without Debugging" command to the Debug menu item
Edit: Full disclosure, I don't actually have VC++2010 Express installed on this computer, so I'm just sort of winging it here.

If you want to have a "Start Without Debugging" icon on the menu bar instead of in the drop-down Debug menu (even if Tools->Settings = "Basic Settings"), do this:
Tools->Customize->Commands->(choose Menu bar)->Add Command->Debug->Start Without Debugging->ok.
Then Move Up/Down if you want to change its position.

Related

Starting VS2019 and either starting profiler or skipping welcome screen

I often use VS 2019 (16.8.5) to profile applications developed with Qt on Windows (10). I've got it configured as an external tool in Qt Creator.
However, every time I open it by just running devenv.exe, I have to go through the same process of clicking "Continue with No Code" on the startup welcome screen, then selecting Debug → Performance Profiler from the menu. I'd like to automate that as much as possible.
So my question is: Is there any way, from the command line, to start the IDE, skip that welcome screen, and go straight to the profiler? If not, can I at least skip the welcome screen?
I looked in the manual but couldn't find anything that seemed to do the job (/NoSplash doesn't skip the welcome screen, btw). However, I noticed that the output of devenv.exe /? in the console listed a slightly different option set, and also there's the /Command switch (which I also read the docs for), and both of these together, combined with past experience, lower my confidence in the completeness of the documentation there. I also found Running the Visual Studio Profiler from the command line but it discusses using the command-line profiler directly; I want to run the graphical profiler in the IDE, though.
If there's no way via devenv.exe, is there maybe some other way to automate this? And if there is a way, the bonus question is: Can I go further than just opening the profiler and actually start profiling given an executable filename or a running PID?
You can start VS and open the profiler like this:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" /Command Debug.DiagnosticsHub.Launch
It is easy to configure Visual Studio Code to your liking through its various settings. Nearly every part of VS Code's editor, user interface, and functional behavior has options you can modify.
in order to stop the welcome screen do the following things
go to File > Preferences > Settings
search "Startup Editor"
choose "None" from the drop-down menu
in order to edit / make a new screen when app started follow the below steps
go to File > Preferences > Settings
search "Startup Editor"
choose "NewUntitleFile" from the drop-down menu
Setup your own file

CLion has Run buttons greyed out or they dont work correctly

I just got CLion today, and wanted to try it out. However, no matter what version I use, the following comes up when I open the run menu (I am on Windows):
Under "Run" in the top bar the normal Run and Debug are greyed out and I can only use the Run... / Debug... ones
In the top-right corner of the IDE the run button, the debug button and two other ones are also greyed out.
If I click on the run button or the debug button from the run menu (the ones with ... on the end) there is a run option 0 called "edit configurations" which allows me to make a new run configuration.
So I tried to set up something that works, but I was unable to do so. I also could not find anything on the internet that I was able to understand, and every tutorial that I watched had already had it working.
Could someone please help me in an idiot-proof way?
Minimal working sample (macOS) - nothing fancy, just a good old Hello, world!
Minimal working sample (Windows 10) - nothing fancy, just a good old Hello, world!
Install Visual Studio 2019
https://visualstudio.microsoft.com/vs/
Configure toolchain
Run sample code

No reverse debugging for C++ Eclipse project

I installed Eclipse CDT and MinGW on Windows 8.1 and can launch an "Hello World" project but have no reverse debugging controls.
I saw on the net that I had to activate them in the "Customize Perspective" dialog.
When I try to activate the different commands (like "reverse resume, reverse step into") in the "Tool Bar Visibility" tab I get the error message
the command cannot be made visible in this dialog
How can I enable the reverse debugging controls in Eclipse (CDT)?
I ran into the same problem (and error message) under Linux.
I followed this Eclipse FAQ entry which seems to be a bit dated. What I actually ended up doing was:
menu Window -> Perspective -> Customize Perspective...
tab "Action Set Availability": check "Reverse Debugging"
After enabling reverse debugging there, I still cannot change the visibility in the "Tool Bar Visibility" tab of the Customize Perspective Dialog but I get another icon in the tool bar that says "Reverse toggle".
upon turning on reverse debugging via that button I have the full set of reverse debugging controls in the tool bar.

run option gone from Microsoft Visual C++ 2010

I think I accidentally changed some settings in my MSVC 2010 compiler and now I can't find the compile and execute option. Also when I hit the tab button for indentation an arrow(->) appears. I wonder whats wrong??
Use the tools menu "Import and Export Settings" then select "Reset all Settings" to reset the settings back to default.
To reset editor blunder, just hit Ctrl+Shift+8, from inside the text editor itself. This is toggle-able option, which can be used to see white spaces. Sometimes useful!

Run .exe outside IDE but use break points inside IDE

Using VS .NET 2003. Would like to run the .exe from outside the IDE (i.e. command prompt or double clicking .exe icon in windows) However, still want break points to hit in the IDE.
How do I set this up?
(Running from outside IDE but IDE seeing it as run from "Debug" -> "Start")
Thanks.
On the Debug menu, choose the "Attach to process" option to attach a debugger to your externally-running application.
Visual Studio enables Just In Time Debugging by default. If you haven't turned it off you can call DebugBreak() and you will get a popup allowing you to attach a debugger. If you don't attach a debugger then the program will exit, so you could try wrapping the DebugBreak call in a MessageBox or some other conditional code based on an environment variable or config item.
Since it is C the call to DebugBreak() is correct - this will give you a nasty error dialog (different look depending on the OS), which should have a 'Debug' option. If you click this you should get a dialog to select one of the installed debuggers (VS.NET shoud be among them). Selecting it should bring you to the DebugBreak() line. However this can fail if the debugger can not find the pdb files for your app - in that case you will just get the disassembly view and no source code view.
You can also use WinDBG and the 'Open executable option' - again it will need the pdb files to yield anything useful.