Author Topic: [SOLVED for now] [I am new to CODE::BLOCKS, and I'm stuck!  (Read 4288 times)

Offline James_Elliott

  • Single posting newcomer
  • *
  • Posts: 2
I went to 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
« Last Edit: July 08, 2019, 07:55:00 am by James_Elliott »

Offline blauzahn

  • Almost regular
  • **
  • Posts: 173
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:

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.

Offline James_Elliott

  • Single posting newcomer
  • *
  • Posts: 2
Re: [SOLVED for now] [I am new to CODE::BLOCKS, and I'm stuck!
« Reply #3 on: July 08, 2019, 08:12:55 am »
Thanks to all of you who tried to help.  As far as I can see, I have all my components in the directories you nominated, but still, nothing happens when I click on Build & Run, and there is no executable created - in Linux, that is.  However, CODE::BLOCKS downloaded and installed into Windows 10 does work! While Windows displeases me in so many ways, I have to admit that it is so much easier to install applications under Windows than it is under Linux. So, for the time being, I will use the Windows version of CODE::BLOCKS to teach myself C++ and when I have time I will revise my knowledge of Linux (I graduated from university with an IT degree in 2003, so I have forgotten a lot of what I learned about Linux). Then I might be able to understand your advice. What is quite clear and logical to you competent Linux users is just gobbly-gook to those of us who do not know Linux, or have not used it for a decade or more and forgotten most of what we once knew. When I have re-learned Linux, I will re-read your advices and try and sort out my copy of CODE::BLOCKS, and, hopefully, get away from using Windows.

Many thanks, James.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7596
    • My Best Post
Re: [SOLVED for now] [I am new to CODE::BLOCKS, and I'm stuck!
« Reply #4 on: July 08, 2019, 07:56:24 pm »
It is really too bad that a College Degree does not teach how to cut and paste.
Note: This is not sarcasm, I learned on the job how to cut and paste from a cmd.exe prompt.
There is a lot of basic info that is never covered in a college degree.
And, I have a 4 year Degree in Computer Science.

Tim S.
« Last Edit: July 09, 2019, 02:23:07 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
When in doubt, read the CB WiKi FAQ.