Author Topic: A library of Code::Blocks projects ?  (Read 5044 times)

Offline johne53

  • Regular
  • ***
  • Posts: 253
A library of Code::Blocks projects ?
« on: October 09, 2010, 03:23:11 pm »
This only occurred to me this morning but maybe it's been suggested before. It's one of those ideas that's blindingly obvious but somehow, everybody missed it.

Code::Blocks is an open source, cross platform IDE.
There are many open source libraries available today.
There are very few cross platform build environments. For example, make works well with *nix and gcc but doesn't work with VC++. VC projects work well for Windows compilation but can't be used for other platforms. XCode is apparently superb for OS-X development but not for anything else.

Wouldn't there therefore be some merit in maintaining somewhere a downloadable repository of C::B projects for other open source projects?  For example, official C::B projects for libglib, lingtk, libpango, libfftw3, libxml etc, etc. Maintained voluntarily by the C::B development community.This might be pretty useful for boosting Code::Blocks's popularity. Does such a thing exist? Or does anyone else think it's a good idea?

Online ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5237
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: A library of Code::Blocks projects ?
« Reply #1 on: October 09, 2010, 04:03:22 pm »
I have some experience in some libraries.

opencv : it use cmake, so it can generate a cbp project for codeblocks
ode(open dynamic engine), it use "premake" tool to generate cbp project for codeblocks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: A library of Code::Blocks projects ?
« Reply #2 on: October 09, 2010, 08:35:41 pm »
I'm involved in a large project with around two dozen sub-projects. It can be built either with gcc or Visual C++. For convenience I maintain two independent Code::Block workspaces but in fact, the differences between them are relatively few. Often they're just to do with debugging. For example, most projects use DEBUG for identifying a debug build - but VC++ builds usually benefit from defining _DEBUG or NDEBUG too (as appropriate). VC++ builds also tend to benefit from defining _MBCS which is rarely needed for any other compiler. And #defined preprocessor strings are handled slightly differently too. The preprocessor directive PACKAGE="libgtk+" usually needs to be sent to gcc like this:-


and to Visual C++ like this:-


Other compilers might be subtly different again but these are fairly minor differences. It might even be possible to adapt C:B itself to make the changes automatically when switching a project from one compiler to another.

The only question is whether the Code::Blocks community is large enough and enthusiastic enough to develop such a repository. Since the 3rd party projects are constantly under development, it would probably work best if any given C::B contributor was focussing on just a small number of them - so the number of contributors would probably need to be quite high. I suppose that might make it difficult.

It would be interesting to know if any C::B users already have a favourite library that they'd be willing to maintain for the benefit of the whole community.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6995
    • My Best Post
Re: A library of Code::Blocks projects ?
« Reply #3 on: October 09, 2010, 10:03:28 pm »
You might wish to use/see wxdemo on wxcode to build C::B projects.
It is using premake or CMake which can be used to create C::B projects.
I was planning to do it; but, I just do not have the time and energy.

Tim S.
« Last Edit: October 09, 2010, 11:11:58 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
When in doubt, read the CB WiKi FAQ.