Can CodeBlocks still be used as an IDE?

This discussion took my attention and it was not in so much distant past - https://forum.openframeworks.cc/t/where-are-the-codeblocks-project-files/31306

@hamoid there suggests that the section of the ofBook about the CodeBlocks should be updated (as though it was no longer supported), using rather VS/Qt for Windows, Qt for Linux, but anyway, I wonder if anyone still uses the IDE of CodeBlocks.

I remember working with CodeBlocks in OF versions of 0.72 and 0.73 (later releases had issues with newer version of CodeBlocks on Windows) and then a good while later switching to Visual Studio/QtCreator when OF v.10 was out (thanks for everything, support for mouseScroll events and keys such as CTRL, ALT etc. was a great improvement).

Some people might have problem with how QtCreator changed recently - even the recommended version 4.6.1 is based on online registration model; it was made skippable for some time, and again the registration/logging in can’t be skipped to proceed to installation.

But OF does not depend on any IDE, in fact you can compile your project straight from the console using mingW from either Windows or Linux (hopefully Mac OS X also has some alternative).

I’ve come into conclusion that programming for UNIX system standard such as Linux/Mac is better than programming in some Windows IDE. At least Windows 10 utilizes some fault-tolerant heap procedure by default to ensure that even if you got a memory leak on heap level, it tries to cover it up and be “tolerant” towards it, thus ignoring a runtime issue that should not be in the code in the first place (sometimes, it will crash, and sometimes it will run anyway, kind of treacherous if you think your code is running ok). If you compile and run the same code in linux, the program will close (crash) immediately, without any attempts to “prevent memory leaks” from the side of OS.

Now I’m experimenting with Atom on Linux, even though the packages don’t always work as expected (or have some mutual dependencies), but nevermind. Everything can be compiled straight from the terminal and the warnings/errors can be saved to a logfile.

Come to think about it, CodeBlocks is not a bad IDE and maybe the CodeBlocks section in the ofBook is still there for a reason. According to what is written there:

It is quite “light” in terms of downloading and we (the contributors to this book) use it in workshops over Visual Studio, which can be a bit intimidating for beginners.

, I wonder and am interested if maybe any of you core developers of the OF still use it…
If I understand it correctly, any IDE can be customized to compile/debug/run OF projects with the correct paths to compiler/debugger though it may not be officially supported.

Hi! Not sure how it is in Windows, but in Ubuntu and ArchLinux I think you can just install the qtcreator package with apt or pacman and it doesn’t ask for any registration. I’m using qtcreator 4.11.1 on ArchLinux and it works well.

We’ll see about that. Currently, besides Windows 10, I have two linux systems installed - Lubuntu 18.04 LTS and Fedora 31.

Just tried to download the linux installer .run file for QtCreator 4.6.1, and anyone can try it themselves - the button that was formerly the Skip button is now replaced with Next which will be active only once you sign/log in I guess… :stuck_out_tongue:

Anyway, for Fedora, I’d need flatpak version of QtCreator, and if version 4.6.1 is recommended and supported by the OF community, I guess there is no better choice…

@hamoid You’re right. Need to point out that there’s a difference between the installer .run file you can download and run (the Qt wizard that requires registration) and the installer_source folder. Inside this folder, there are 7zip packages of QtCreator that runs straight from the executable files for each platform. Just tried and it works :+1:

But nevermind, let’s just pretend it doesn’t work - I guess OF could be configured right to run on any C++ IDE if you can compile the projects anyway, straight from the terminal?

Yes, the download from the qt website and the packages you get from your OS are different.

But on your original question, I don’t consider myself an expert but I woud say yes, it can be made to compile from the terminal, as that’s what in the end QtCreator does: issue a very long command calling gcc+ or clang+ and pointing at all the right files and folders.

Not sure you care about this option, but once you have the project configured in QtCreator you can call qbs build in the terminal and it will compile the project.

Also, to make it work in CodeBlocks one option might be to observe what gets called by QtCreator, then try adjust CodeBlocks so it produces a similar call to the compiler.

Just tried it, though needed to install the qbs package via terminal - it says it’s cross-platform build package, and it compiled quite nicely in the terminal. Now running your same QtCreator 4.11.1 version myself. Though configuring QtCreator to resolve the issues at the start is always a hassle.
At first, libmpg123 was missing and it disabled the projects in the IDE, then installed the codecs just for sure, also installed apt even though apt is for Debian (I’m currently on Fedora), but it seems that reboot managed to resolve the discrepancies…
Now I’ll be repeating myself, but really, configuring QtCreator to resolve the issues at the start is always a hassle.

Hello people:
As a beginner in c++ and OF, but having some experience in other languages, I got used to code::blocks and I wanted to use it despite not being officially supported. I found a workaround by copying the workspace and project files from OF v0.8.4 and editing these files by hand (myProject.cbp and myProject.workspace). Since the folder tree is the same, it worked so far if I copy any of the example folders and keep the addons.make, config.make and makefile files. It is important to put your project folder at the same directory depth as the examples.
I want to thank you all for this invaluable framework. I hope to learn and contribute soon.
Best regards.

1 Like

Great to know :+1:
CodeBlocks is such a nostalgic IDE for me… used it since OF 0.7.2 or maybe earlier…
I remember there were problems with later CodeBlocks releases so I (and bet that others also) used the old IDE versions.
But since you claim to have managed to run it successfully, I assume you’re using the latest version of Code::Blocks?
Code::Blocks is a great IDE and if I’m not mistaken, it also does have support for such a useful tool as valgrind is…

I assume you’re using the latest version of Code::Blocks?

Version 17.12 precisely, running on Debian Stretch GNU+Linux.