How to make eclipse cdt(c++) build&run in one button? - c++

I code in c++ using eclipse cdt.
Every time i make changes i have to press this combination:
ctrl+s - save(without saving, just hitting the run button runs the
old version of code)
build(hammer button)
run
I remember i could just hit the run button - and it would do all 3 steps - save, build,run
How to make the run button achieve and do all this work?

This is configurable in the "Run Configurations" settings.
From the toolbar, go to Run -> Run Configurations...
Select your run configuration on the left
On the "Main" tab on the right, look for "Build (if required) before launching"

Related

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

Qt .exe file error

I was making a sleeping detection program with GUI. I decided to choose Qt for the project. I was able to build the program but when I ran it, this message popped up which I had no idea what was wrong.
Starting
C:\Users\Helianthus\Documents\QtProject\build-facelandmark-Desktop_Qt_5_11_1_MinGW_32bit-Release\release\facelandmark.exe...
Failed to start program. Path or permissions wrong?
C:/Users/Helianthus/Documents/QtProject/build-facelandmark-Desktop_Qt_5_11_1_MinGW_32bit-Release/release/facelandmark.exe
exited with code -1
The process failed to start. Either the invoked program
"C:/Users/Helianthus/Documents/QtProject/build-facelandmark-Desktop_Qt_5_11_1_MinGW_32bit-Release/release/facelandmark.exe"
is missing, or you may have insufficient permissions to invoke the
program.
Open the Qt installation path(such as:'C:\Qt\Qt5.14.2\Tools\QtCreator\bin').
Right click on the 'QtCreate.exe' program.
Select 'Attributes' or 'Property' on the Menu.
Select 'Compatibility' tab on the popup window.
Click 'Change settings for all users' button.
Check 'Run as administrator'.
Click 'OK' to close all the popup window.
Restart QtCreator, you will find it works correctly.
Just had the same problem, I fixed it by doing the following:
Go to Tools -> Options -> Buid & Run, if you scroll down the bottom of the dialog, there is a dropdown field called Build Before Deploying, you just need to set that to Build only the application to be run, then run the application again.

Run as administrator not showing in start menu

Background:
My C++ application developed by VS2008 and use the VS setup project to create installer for that. After installation it will create two shortcuts to application. one is in user desktop and second one is in start menu. Application(myApp.exe) installed to the Program files directory.
Question: If I right click on the icons in the start menu, there is a option Run as Administrator for most of them. But if I right click on the shortcut that related to my application. It doesn't show Run as Administrator. How to fix this?
Edit: But if i right click on the myApp.exe in the Program files, it shows "Run as Administrator".
Set your embedded manifest to require administrator. On the project property page:
...on the (highlighted) UAC Execution Level, change asInvoker to requireAdministrator. Build your project to embed the new manifest, and it should be ready to do its thing.
Oh -- I didn't think to do it here, but in the Configuration drop-down, you probably want to select All Configurations, instead of the (default) Active configuration that's selected in the screen shot. Gets seriously annoying -- you think you've got things fixed, then you change to "Release" and a bunch of stuff suddenly breaks, and you have to go through figuring out what you'd changed, and edit those changes into the Release configuration as well.
In manifest file there is option "requestedExecutionLevel" and "UIAccess" which will manage it.
I found the answer for this after so much testing and searching. So here I mention it for use of any one.
Windows only shows Run as Administrator in the context menu for that shortcuts those are directly targeting to some exe file.
If you use VS deployment (setup) project to create your installation with desktop and start menu shortcuts. Those shortcuts not targeting to exe (Application.exe) file.
Instead of that shortcuts targeting to application folder (MS office 2007 also same). This is called installation-on-demand and advertisement. Here is the more details.
This will help your application to repair from file missing (pray Google for more).
So we have to disable this feature if you want to target your shortcuts directly to exe file.
For this you can use command prompt or some tool. here is how to do it.
Nirmally windows installer having a exe and a msi.
These setting are stored at at msi generated with setup file.
So You have to alter the file and add the entry DISABLEADVTSHORTCUTS=1 to property table.
Using Command prompt:
msiexec /i <path to your msi> DISABLEADVTSHORTCUTS=1
Using Orca Tool:(Meny other tools also there)
Download Orca tool from here and install it.
Right click your *.msi file and click edit with orca.
Go to property table and add new entry DISABLEADVTSHORTCUTS and value is 1 , save and close.
Now you done.
Install using setup.exe file and check the target of the shortcuts. those are directly target to the exe file in application folder.
Now if you right click on the shortcuts those shows Run as Administrator option in context menu.
Note: Doing this you will gain Run as Administrator but scarify the windows auto repair capability.

NetBeans - C++ build current project

When you work on NetBeans there is a defined main project.
And when ever you press the build or run button that project is being executed.
I was wondering if there is a way to build the current project I'm viewing.
So say I jump between projects and hit the run button, the project it will run will be the one in my current edit view.
In the newest version of Netbeans, currently 7.2, there's no such things as main project. Hitting F11 or the icon will automatically build the project which file you're viewing.

How to run app from VC++ without debug?

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.