I have just switched to linux.
Thanks in advance!
Your C++ program is not running in Code::Blocks because you do not have a C++ compiler (a version of G++) installed, or if it is installed you have not configured the C++ compiler in the Code::Blocks compiler settings. The C++ compiler is not configured for any version of g++ in Ubuntu 18.04 by default, so it has to be configured in the Code::Blocks compiler settings.
Install the latest version of the g++ compiler for C++.
sudo apt install g++-8 xterm
Optionally install the latest version of gcc too (recommended).
sudo apt install gcc-8-base # recommended version
Start Code::Blocks.
/usr/bin. The C compiler should be either gcc or optionally gcc-8, the C++ compiler should be g++-8 and the Linker for dynamic libs should be g++-8.------------- Run: Debug in hello_linux (compiler: GNU GCC Compiler)---------------
Checking for existence: /home/rafid/Desktop/Study Materials/Code/C++/hello_linux/bin/Debug/hello_linux Executing: xterm -T hello_linux -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/rafid/Desktop/Study\ Materials/Code/C++/hello_linux/bin/Debug/hello_linux (in /home/rafid/Desktop/Study Materials/Code/C++/hello_linux/.) Process terminated with status -1 (0 minute(s), 0 second(s))
– Rafid Haque Aug 17 '18 at 09:12I tried to install codeblocks in bionic and it was almost a night mare as so many dependencies are needed. In the case of the question OP was missing the xterm terminal that codeblocks uses to work and that can be found in the libwxbase3.0-0v5 package, when you try to install this it will complain then you run sudo apt install -f and it will install xterm as part of the dependencies.
Please note that the codeblocks download comes with the dependencies needed in the archive filecodeblocks_17.12-1_amd64_stable.tar.xz from their down load site.
Maybe ur problem is that you saved the file in the default format (.ads) provided by codeblocks. I had the same problem but solved it after I renamed my file extension from .ads to .cpp.
Hope this helps
sudo apt install build-essentialfrom the command line? – Joshua Besneatte Aug 17 '18 at 07:52xterminstalled? As I tried to install codeblacks and it needs xterm! – George Udosen Aug 17 '18 at 09:29