Eclipse runs old code even after building the new one - c++

I started to study c++ and i choosen Eclipse IDE for it.
I need some basic instructions.
Even after i compile my code with ctrl+b Eclipse shows me the old "Hello World" program in console. If i look up the compiled .exe files in my projects "Release" folder i can ran my new program very well.
For some reason Eclipse does not refresh output console.
Any ideas?

Have you tried checking that there are not still multiple consoles open. On the console tab try clicking the Display Selected Console button, or pushing the red terminate button until it becomes greyed out and then running it again.

I saw at the output console's setting's that it is showing my project's Debug release.
So i searched for the compiled in my Debug folder and i saw it was the old .exe of my project.
After that i did the same thing within the Release folder that was the new code!
So all i did was changed the run configuration to Release, pic below.
And now it is working.

Just clean the project from menu...

Related

Visual Studio 2008 c++ Executable (Debug and Release) not working

hope someone can help.
I'm currently writing a 2D game engine in c++. When I run the application from within Visual Studio 2008 using either debug or release all goes fine.
When I then run the executable files (either debug or release) from Windows Explorer, neither work and just display a blank Window.
Does anyone know what is causing this?
Load project into VS 2008
Change configuration to "Debug"
Click the "Start Debugging" button
Application compiles and builds, all is ok
Application runs, all is ok
Close Application
Output window in VS shows "The program '[16672] Mouse Engine v2.exe: Native' has exited with code 0 (0x0)."
Open Windows Explorer window and locate executable file from the Debug folder in project.
Run executable, blank window is shown.
Change configuration to "Release"
Click the "Start Debugging" button
Application compiles and builds, all is ok
Application runs, all is ok
Close Application
Output window in VS shows "The program '[18872] Mouse Engine v2.exe: Native' has exited with code 0 (0x0)."
Open Windows Explorer window and locate executable file from the Release folder in project.
Run executable, blank window is shown.
Some things to look for are missing dependencies such as config files and data files that your program can't find.
You can also try Dependency Walker to make sure all your dll's are available. http://www.dependencywalker.com
There are a few things to check to resolve this sort of problem.
Check all variables are initialised. Seems obvious but this can be crucial. I found best way to solve this is to #DEFINE _LOG at start and output variable values to a log file in each function using #IFDEF _LOG. This way you can turn it on or off.
If your application is just a blank window, check if it is running (using CPU time). This is a good indication that something is preventing it to find any image or font files.
Check that the Debug or Release folder structure matches that within your project folder to ensure links to files and textures work.
Make sure in project preferences to set the Runtime Library entry to Multi-threaded (/MT). This should make your application less dependent on additional dll’s.
Check for problems in your code. See point 1 with using log files to help with this.

Qt Application not running

I am trying to run a simple "Hello, world" console application but I am experiencing some errors when compiling that I am not familiar with. I have done a bit of research into similar problems with Qt but I haven't been able to find a solution. The closest solution I have come across was to change my Patch Command setting under:
Preferences -> Environment -> System -> Patch Command
to
usr/bin/xterm -e
However, when I try to do this it goes red indicating that I do not have this file.
Environment Preferences Window
The following image is a screenshot of what is displayed in the terminal window when attempting to compile my project.
Console Application Output
Any help on this problem would be much apprectiated! It is very frustrating having something like this hold me back!
Don't run your project in a terminal unless you actually select a working terminal, and that's all. The patch command is irrelevant in this anyway - it's not the terminal, but the patch command -- used to patch source code. You don't need it unless you explicitly use code patching. Go to Projects (Ctrl-5), click on the active Run configuration for your project, uncheck "Run in terminal", done.

Eclipse c++ never run when build has errors

When programming in eclipse (c++), I would like to just hit f5 (run) and have the project I'm working on save, build and (if there are no errors) run. If there are errors I want it to show the problems window and stop.
This all works at the moment except for the part where it shouldn't run when there are errors.
Is there a way to make eclipse never run the project when there are errors? Perhaps with an addon?
EDIT: Forgot to mention the prompt... The prompt does show but I want it to not show at all. If you look at the preference window you'll see that there's no 'never' option, there is one for all the other options but not for the 'launch if project contains errors'.
By default, Eclipse CDT does not run code with build errors, but maybe you have checked the option Always launch without asking checkbox.
You should go to Windows menu->Preferences->Run/Debug->Launching->Continue launch if project contains errors and check Prompt option instead of Always. Using this, Eclipse CDT will prompt you if errors exists during building or launch your binary if it has been compiled without errors.

running C++ program on xcode

when I run a simple C++ program on Xcode, the compiler says it's built successfully, but there is no output. how can I make the result show up? thanks!
Cmd-Enter is the default "build and run" keyboard hotkey. Once you've pressed that, use Cmd-Shift-R to open the console and see your program's output.
in the tab Groups and file, under the xcode icon of your project there are 3 folders, Source, Documentation, Products, under Products there is your executable.
hth

Getting Started with Eclipse CDT

I have downloaded the latest Eclipse CDT release (Helios) and wanted to try my luck with some C++ programming (haven't done that in ages).
I tried to do the "Hello World" project, but I got stuck quite fast.
First thing - the #include <stdio.h> and #include <stdlib.h> got marked with an 'Unresolved Symbol' warning. So I found the place where I can add include paths and pointed it to these headers from the Visual Studio installation I have.
After that, it looked fine but:
I don't see compilation errors/warnings in the Problems tab.
I cannot run the code - I get 'Launch failed. Binary not found' error
My question is simple - what are the steps I really need to do to get my code compiled, linked and executed?
I tried looking for it on Eclipse's site, but didn't find any reference to that.
I'm making a guess here, that your are running on Windows, because that particular error seems to be a windows related one.
You seem to be missing the basic toolchain needed by the CDT to actually build the project. You need some files Before You Get Started. I suggest the mingw installer, as it is simple, and lets you actually build Windows compatible binaries.
Check out the link above, and then make sure your project links to the toolchain. Hope that helps.
A starting point could be:
File -> New -> c++ project
Type a name for the project, select Hello World c++ Project under Project Type and click Finish.
Right click on the project -> Run As -> Local C++ application (or just click the Run button on the toolbar).
I was getting the same error until I ran the "Build All" command. That command created two new folders, Debug and Release. Then when I clicked the "Debug" button, it asked me which one I wanted to run and I selected "Debug" and it ran perfectly.
It seems like the binary it couldn't find was created from the "Build All" command.