Author Topic: I am new to CODE::BLOCKS, and I'm stuck!  (Read 213 times)

Offline James_Elliott

  • Single posting newcomer
  • *
  • Posts: 1
I am new to CODE::BLOCKS, and I'm stuck!
« on: May 07, 2019, 04:25:39 am »
HI,
I went to www.learncpp.org to learn C++. I followed their instructions to install the CODE::BLOCKS IDE on Linux Mint 19 Cinnamon, without much success.
I then went to the Linux Mint forums and followed their instructions to download and install the CODE::BLOCKS IDE using a terminal window - this worked! After a two-stage download and installation process (GCC + CODE::BLOCKS), I ended up with the CODE::BLOCKS IDE installed on my Linux PC, and listed under 'Programming' on my Mint main menu.

When I click on the icon for CODE::BLOCKS
  • the application fires up and presents me with the IDE
  • I can initiate a New Project and save it
  • I can write my C++ code (e.g. 'Hello World')
but when I click on 'Compile' nothing seems to happen and no new .cpp executable file appears in my directories.

If any of you clever people could point me in the right direction I would be very grateful.

I am learning C++ to use with Arduino microcontroller boards.

Many thanks,  James


Offline blauzahn

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: I am new to CODE::BLOCKS, and I'm stuck!
« Reply #2 on: May 07, 2019, 07:06:33 pm »
first, please verify that you can compile and run your hello_world.cpp from the commandline:

Code: [Select]
g++ -Wall hello_world.cpp && ./a.out

Then start Code::Blocks and check, if your compiler path and executables are
set correctly (see: settings|compiler|toolchain executables. Probably, your
path for the selected GNU GCC Compiler should be /usr and the C++ Compiler g++.

In Order to see the executed commands when you start to compile, please
go to settings|compiler|other settings and select as compiler protocol:
full commandline. Once, you have closed the settings, open view|Logs (F2).
When you start compiling your hello world project from inside Code::Blocks,
the appropriate commands should show up the logs.

If compiling and linking were sucessfull, the binary for target Debug is
by default in the project's subdirectory bin/Debug. This you can start
from Code::Blocks or from the commandline.

I hope, this helps.