I'm kinda a newby but I already went crazy on this issue for three nights.
I've been using VS Code to run c++ with code runner on my chromebook for 2 months, and I had no issues.
Now I installed VS Code on my main Windows PC and i correctly installed the latest versions of g++ and gdb, infact VS Code compiles with no error every code.
The problem comes when I enable the setting "Whether to run code in Integrated Terminal", VS Code compiles but when I run code it doesn't do anything. I already serached on this forum but didn't find any correst answer so I prey you to help me, at least.
Obviously I'm talking about EVERY program, even "Hello World", if I enable that option and then run the code, it doesn't do anything and my output is empty.
Thanks to everybody.
P.S. I'm sorry for my english.
I'm a beginner in C++ and I started an Udemy course. In that course they recommend using CodeLite as IDE, so I decided to give it a try. In the course, they write a basic program that displays "Hello world!" to show how the IDE works. They compile then execute it, and a terminal window opens with the "Hello world!" message like normal.
In my case, after following the setup process step by step and using the exact same code as them, when I compile and execute the code, my terminal flashes for a split second and then disappears. In their video the terminal remains open but I thought that since they have an older version of CodeLite maybe in the newer one that I have, the terminal is supposed to close by default.
I went online and found people saying that a way of keeping the terminal open is by adding #include and system("pause"); on Windows, but in my case the terminal keeps behaving the same, and CodeLite doesn't report any problems. I've also tried cin.get(); with no success.
Any idea what could be causing this problem?
I had the same problem and I did these steps to solve the problem:
Uninstalled CodeLite.
Installed MinGW correctly.
Then reinstalled CodeLite.
Then did tutorial steps: Click Scan then select MinGW.
After I did these steps, it worked normally.
I had the same problem running Codelite on OpenSuse Leap 15.1. I eventually found a very simple answer. Go to the Settings menu, select Preferences and then Terminal, on the left towards the bottom. Change it to konsole to use the standard terminal, rather than the codelite-terminal.
I know this is an old question, but did not see the answer that worked for me. Debugging (F5) will close the terminal after completion.
However, running/executing (CTRL+F5) will not. Leaves terminal open. At least this is the case for me, and hopefully this helps someone out.
I know this is an old question, but CodeLite has a Project-level setting for "pause when execution ends" which will pause the program before the terminal closes so that you can see outputs and the like.
To turn on just right click on your project, go to settings, and it should be in the center of the general tab.
I went online and found people saying that a way of keeping the terminal open is by adding #include and system("pause");
And this is the wrong way to do it - the desire to leave the window open/closed is not meant to be controlled by your program; but the thing calling it. For example, you break the ability to run it as part of a headless script.
Much better would be to run it in debug and put a break point at the return of main, or to find the configuration option in your IDE that stops it closing the window.
I am not aware why CodeLite would behave like that. If you really added some pause or blocking call and it still closes, it looks like it is not really running the program (e.g. something breaks before that or something is misconfigured).
First, try to open a terminal yourself (e.g. cmd or PowerShell on Windows), and execute your compiled program there -- that way, the terminal will remain open. If that works, then compilation went fine, but something is wrong with CodeLite's configuration, most likely.
Otherwise, as a last resort, since using CodeLite is not strictly required, simply switch to another IDE/toolchain, e.g. Visual Studio (on Windows).
For some reason, after closing and reopening CodeLite, it now works, the terminal remains open when I run it from the IDE. I don't know what solved the problem since I've closed and reopened CodeLite at least 5 times before this without anything happening. Thanks for the help though.
I had the same issue. What I found wrong was that the compiler that I installed was 32bit and I was using the 64bit CodeLite version . Try Installing the 32bit CodeLite version and it should work fine.
It worked for me.
I had this problem also, I tried uninstalling and reinstalling code lite but the problem still occurred.
I went back and checked the Environment Variables in control panel and I had placed the systems variables in "Path" to the incorrect Bin directory.
I corrected the entry, uninstalled and reinstalled code lite again and the problem was resolved.
Hey I also had the same problem, doing the same course! What I did was to relocate my mingw-w64 folder, deleted the earlier path from environment variables and added the new path. I uninstalled CodeLite; not saving the user information. I actually downloaded the 14.0.0(64-bit) instead of the newer version 14.0.1(64 bit) . Then I did the steps that Frank tells you and it worked out for me.
I am completing the same Udemy course and encountered a similar problem of the console closing immediately. I encountered the problem for a workspace with 1.) a long name and 2.) ending with an underscore "_". I reduced the size of the folder name which also involved deleting the trailing underscore. This appears to have solved the problem. I encountered this problem with one of Frank's provided workspaces so I knew it was not a compiler issue.
I had an issue with section 20 of my Udemy course because it had parenthesis in the workspace folder name. "(STL)" at the end. Once I got rid of the special characters, it worked fine.
If pause("system"); or cin or restarting Program and whole PC solutions are not working, then make sure to:
Copy your code.
Create new Project and past your code there.
Make sure the new project is selected before trying to double-click it.
Notes:
You can now delete the old not working project and rename your new project.
I don't know what's the reason of the problem, but I did that and it worked for me.
You need to make sure if it is 64bits CodeLite then you have installed 64bits MinGW. Through the IDE itself, you can re-run the setup wizard
Restarting Codelite worked for me ...
I am developing a C++ project with Xcode.
My Xcode keeps crashing out of nowhere. It does so often that it is nearly impossible to work at all. I have been using Xcode 6 until now. Since it kept crashing, I just thought I would format everything. I did a clean install of Yosemite and then downloaded Xcode 7 beta 2 from the official Apple Developer page. I installed it on my clean system, then pulled my repo and tried to work. Still the same problem.
Here is the log of the crash:
http://pastebin.com/t4gMWa95
I have looked around SO and many answers suggested that this could be related to source control. However, I tried to disable source control from my settings and still it crashes as often as before.
Anyone can give me an idea on what is going on? This is frustrating...!
Hmm the crash is in clang::DiagnosticRenderer::emitDiagnostic which presumably is redering errors and warnings. Could there be something odd about your warnings? Or something that is echoed in warnings classnames, scource file names, paths to source files? Does it happen when there is so little code as to have no or few diagnostics? But first - make a new XCode project and add your source to that, see if the new one works better.
Go to Users>[UserName]>Library>Preferences
Search for "xcode" inside the "Preferences" folder
Move all the resulting files (I had 6 files when I searched) to Desktop
Restart your Mac
Now open Xcode and see if its crashing
These steps solved my problem. Hope this helps...
When I compile and run my code, the console window no longer shows up.
(I have "system("pause");" included, this is not the issue).
I was trying to debug a program in Dev C++ and must have changed some settings. Any advice?
Dev-C++ is really old and the debugger is full of bugs. If you're sure the problem isn't with your code, then I'm assuming you've tried the basics, like restarting Dev-C++ and restarting the computer?
If that doesn't work, try reinstalling Dev-C++... It only takes a couple seconds to install it.
You can also try stepping the code.
I already am awaiting a reply from the Eclipse staff as they are having some bug issue with my account on their website, in the meantime, maybe someone here can shed some light onto this issue.
Basically, I am just starting with C++ and I installed the CDT and MinGW. I followed my professors instructions and got it successfully installed (tested the installation via the command line with a premade file). Anyways I tried to save/compile within Eclipse and it crashed on me, and ever since then it wont even start up now. It loads the interface for Eclipse but within 1-5 seconds it will crash with the same error.
Not sure what is going on, any help appreciated, attached is the image of the error.
Using Eclipse Juno
Try running eclipse with the -clean option: i.e. c:\eclipse\eclipse.exe -clean
Issue is that the Eclipse plugin CDT has an issue with JDK 1.6, I uninstalled 1.6 and downloaded 1.7 and it worked like a charm.