Eclipse: Info: Nothing to build for [Project Name] - c++

I'm currently new to C++ and I created a Hello World in Eclipse C/C++ but all It says in the Console is: Info: Nothing to Build for [project name].... How to fix this? Yes, I have done everything like setting up the variables of my mingw and all that and I still get this message on my Console... I searched all of this stuff on the Internet but It didn't quite help...

You have your console view set to the wrong console.
There is a build console and the normal output console. It should switch to the output console when running, automatically (but, any ways, it didn't).
On the console view there is a set of buttons, one of which looks like a little monitor. If you click on the little arrow next to that you can select the output console for your program:

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 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.

visualstudio code C++ terminal for output

When debugging a C++ application on linux using, VisualStudio Code, an instance of an external terminal window is opened, and the applications console appears on this window.
This is a bit inconvenient because I have to change windows to see the output when debugging.
Is it possible to have the output to appear in a "pane" like the built in terminal appears (like the one started by CTRL-`)? If so how can this be done?
I have tried changing the launch file's "externalConsole" from true to false but this didn't work.
You need to use the Integrated Terminal.
View > Toggle Integrated Terminal
In launch.json set "externalConsole": false,.
Then the output goes to the Debug Console.
But instead of things looking like:
Hello World!
It will show up as:
#"Hello World!\r\n"
I have read that they still work in proper terminal support for the terminal inside VSCode. I think that also explains why it defaults now to the external terminal.

Eclipse runs old code even after building the new one

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...

Eclipse C++ - output to window DOS

I am using Eclipse with C++. When I run the program, I get the following message in my Console window:
**** Build of configuration Debug for project Disks Repulsion ****
**** Internal Builder is used for build ****
Nothing to build for Disks Repulsion
I makes changes to the program and run it again, and this time I get following message:
**** Build of configuration Debug for project Disks Repulsion ****
**** Internal Builder is used for build ****
g++ -oDisksRepulsion.exe DisksRepulsion.o -lopengl32 -lglu32 -lglut32
C:\MinGW\bin..\lib\gcc\mingw32\3.4.5........\mingw32\bin\ld.exe: cannot open output file DisksRepulsion.exe: Permission denied
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 103 ms.
When I first ran the program, it started my program (I can see it running in my Window Task Manager), but there is no output being sent to the console.
After making changes to my program, the program is still running in the background, so I get the "Permission denied" error, when I try to run the program. I can make the error go away by ending the instances via task manager. However, when I run the program, I still don't see any output being sent to the console.
Yesterday, I was able to see the output in my console, but don't know why I cannot see it today. Also, when I saw my output, the cursor's focus did not change from the code to the console. I dislike having to do it manually.
I also don't like that when I make changes to my program, and run it again, that the program is not automatically terminated on its own.
I have used VC++ and I prefer the window Dos for output. So, I wanted to know if there is anyway in Eclipse to send the output to Windows Command Prompt, since I know that the instance of the .exe is really gone when I close the program. It automatically gets cursor's focus. I will also be able to get some output.
I installed MinGW with MaSYS or something, to compile the program.
It sounds like your application isn't terminating on its own and you didn't build in any sort of interface that would allow you to kill the program. This sounds like a bug in your code and not an Eclipse issue. If issuing a Ctrl+C in the console won't kill your program, then look into coding something that will let you kill your app with keystroke or input sequence.
If you want to run your app in a command console, then open a normal command console, browse to the folder containing your project, and run the compiled executable from the console instead of doing it through the Eclipse interface.
A simple solution, which I've been using for ages now, is opening a command prompt yourself and running the executable manually. An advantage of this method is that you can set your "DOS" window's size to anything you want. (Right now I'm using a 120x50 window with 8192 lines of scrollback buffer.) Another one is that you will never lose your console output; in fact, you'll be able to see outputs from past runs. (8192 lines is A LOT unless you're printf-debugging a tight loop.)
An alternative to terminating your program from the taskbar is using the red icons on the top right corner of the Eclipse "Console" window.
Is your program's entrypoint main() or WinMain()? There may also be a setting/link option for the "subsystem," console or Windows I think they're called in Visual Studio.
Anyway, if your program is starting up via WinMain, the expectation is that you'll have a Windows form of some sort through which the user can control the program. If you use main(), then your program should automatically trigger the opening of a console window.
Look up AllocConsole() on MSDN (or google it) if you are using WinMain() intentionally and want a console window to also open up. There's some trickery also available via google search that can hook stdout to this console, but at this time I don't remember what it is. (You basically redirect the stdout handle to your new console.)
Good luck.