I don't have a good experience with codeblocks on Ubuntu. I've tried in 15.10 and 16.04 and it always crashes after a while. I just open a console application, create some .h files and run. I use it for a c++ university class. I don't do complex stuff. I reinstalled many times on both 15.10 and 16.04 and it keeps crashing .
You can use Geany to write, edit, compile and run C++ source code. But if you want to use codeblocks, then please install the latest version of codeblocks 16.01. To install codeblocks 16.01 run this commands in terminal.
Try to disable symbol browser of code completion and see if the crushes stop.
Go to:
And check "✔ Disable symbols browser".
I had the same issue and this solved it.
It would seem that Codeblocks on Ubuntu is unstable. With Codeblocks 16.01 on Ubuntu 19.04, I see the same issues reported by others — editor freezing, and the application closing suddenly.
In a message on the Codeblocks forum, a developer responding to the issue says "You've hit some of the nasty bugs I have no idea how to fix", and he refers to an old discussion from the year 2008 on the wxWidgets developer forum about the problem.
It's a bit surprising that there's a long-standing unresolved bug in a cross-platform GUI library as popular as wxWidgets that causes problems like this, but that seems to be the situation. Unfortunate.
You really don't need CodeBlocks. What you need is
g++
compiler for compiling your code. You should have it installed, if not, then:For convenience to write code, you can install any text editors such as VS Code (my personal favourite), Atom, Vim, Sublime etc. Just create a new file (say,
start.cpp
) in some location of your computer (say,/home/<username>/Codes
) and write some code. Then open your terminal in the same location (so in this case, /home//Codes ). Then type:If you have some inputs in a file (say,
input.txt
) and want to write the output in some other file (say,output.txt
), the command is:That is basically the terminal way of cpp. You will probably make mistakes, so I suggest you ask your teacher/someone experienced with terminal. I hope you will never bother to install CodeBlocks again in youe life :)