John Torjo - C++ Expert

Cross Builder


Welcome to C++ Cross Builder

In short, Cross Builder allows you to build C++ projects very easy. In addition to that, it allows you to modify various compiler settings in a simple and straightforward way. Finally, settings are hierarchical:

  • when you set it once, it propagates to all subdirectories (until you override it)
  • when set for a configuration, it propagates to all its sub-configurations
  • when set for a compiler, it propagates to all its sub-compilers

Indeed, just like directories, configurations and compilers are hierarchical also.

In order to build a project (any project), all you need to do is:

  • mark its directory as "Is Project" (one click)
  • click "Build" or "Rebuild" (another click)

That's it! After a compiler is configured, it can be used to build projects, any project. Once you choose to re-configure your compiler, those changes will apply to all projects you build with that compiler, from then on. Indeed, no more maintenance nightmares!

Note that Cross Builder is Windows-only, but there are long-term future plans to port it to other platforms as well.


What is Cross Builder
Building a project
Building multiple projects
Cleaning up...
Configure compiler
Modifying settings
Selecting configurations/ Selecting compilers
Single Build/ Bulk Build
Compare Build statistics (new!)
Built using win32gui
Source code available! (new)
Future steps

Requirements/ Compilers it currently works for


What is Cross Builder?

Cross Builder is a RAD tool for building C++ projects. It focuses on ease of use, ease of configuring settings, and being flexible. Compiler settings apply hierarchically. This is a very powerful mechanism, and once you see it at work, you'll simply love it!

When you modify a setting, you modify it for:

  • a HDD directory or file
  • a configuration (such as "Debug", "Release", etc.)
  • a compiler (such as "All compilers", "MSVC" (all Miscrosoft compilers), "VC 7.1", gcc (all gcc compilers), VC8 (Visual Studio 2005)

From then on, this setting will apply to all:

  • it sub-configurations
  • its sub-compilers
  • its HDD sub-directories

...until it's overridden. You can modify settings at any level in the hierarchy: they will override anything that is above the hierarchy, and can be further overridden in anything below it (any combination of HDD sub-directory, sub-configuration, sub-compiler).

Think about it! Usually all the files in a directory share the same settings (maybe with one or two exceptions...). Thus, you simply modify the directory's settings, and it applies to all of its files. Even more, if you add more files and/or subdirectories, they simply inherit those settings (you don't have to do anything).

And if you're at it, you can have groups of projects, which share the same settings. Why not group them into a directory, and those settings that are common, set them there?

Sounds familiar? The simplest scenario is when you develop a library, and you develop some tests and some examples for it. Once you get one test to work, then you'll want more to add more tests that share the same settings.

In time, as your application(s) evolve, you'll want to fine-tune the settings (optimize your program, move to another compiler, profile, etc.) - Cross Builder simply makes sure your effort will be minimal.



Building a project

First of all, note that in order to modify a setting, you don't have to be inside a project. You can set it anywhere. You can even set a setting for your Local Disk (the root, in Explorer view). It will then propagate to all of your directories/files, until it's overridden.

Having said that, in order to build a project, you have to create it first. In Explorer View, you can right-click any directory, and select "Directory is Project" setting (or, you can do it from the toolbar). That's it!

In order to build it, simply select this directory in Explorer view,and click "Build".



Building multiple projects

In Cross Builder, you can build any HDD directory (even the whole Local Disk, if you wish). Whenever you do a Build, Cross Builder will simply recurse the current directory, and whenever it meets a project, it will build it. If, while recursing, it won't find any project, it will simply consider the current directory a project, and go ahead and build it.

As the build process is in progress, you're shown the status in a dedicated window. In case anything goes wrong, you'll see the projects that have been compiled successfully, those that failed, all commands that have been issued, and the warnings and/or errors the compiler(s) have generated.



Cleaning up...

Every now and then, after doing one or more builds, you want to clean up all those intermediate files and such. Simply press "Clean", and that's it!



Configure compiler

Most of the time, the compiler(s) should work out-of-the-box. But just in case it's not as exactly like in the fairy-tales, you'll have to configure your compiler(s) to make it(them) work. Click the "Compilers" tab, select the compiler, and configure it. Usually, the most you'll need to do is specify the compiler's home directory, and leave the rest to their defaults.

After you configure it, always make sure to Test it. Simply click the "Test" button; the test will take a few seconds. In case everything goes ok, you'll see "Test successful" in its left. Otherwise, a "Test FAILED" will appear, and the cause of the error will be shown.

As you become more accustomed to Cross Builder, every now and then, you'll go back to "Compilers" tab to do a little more fine-tuning like, add one more Library directory, or, specify a new home directory and such.



Modifying settings

Modifying settings is quite straightforward. When in the top-left pane, in the "setttings" list, simply click a setting, or select it with the keyboard, and press "->". You'll see the available answers, and can simply select them. In case you have "All compilers" selected, there is an extra row, specifying to which compilers the setting applies to (not all settings apply to all compilers).



Selecting configurations/ Selecting compilers

Again, configurations and compilers are hierarchical. Once you expand any of their combo-boxes, you see this instantly. And when you modify a setting, it will apply to all sub-configurations/sub-compilers as well. For example, in our case, modifying a setting for "GCC" will apply to gcc 3.3 and gcc 3.4.2.



Single Build/ Bulk Build

When doing a build, you can choose between Single Build, which builds only the current configuration and compiler (shown in the top-left pane), or specify exactly what configuration(s) and compiler(s) to build it for.



Compare Build Statistics

Every now and then, you'll wish to see how a compiler relates to another - in the generated size of the .obj, .exe files, compilation times, etc. Or, simply compare a build with a previous build - very useful when you want to see how what you're working on affects compilation speed.

Thus, you'll enjoy "Build Statistics". Cross Builder computes statistics (CPU time, file size, etc.), for each file you build. Later on, you can view details about a certain build, or even compare a certain build with another. For instance, you can build a project with gcc 3.3, and then with gcc 3.4.2, and then see how they relate to eachother (just between you and me, gcc 3.4.2 is usually faster).

In addition to the above, every time you do a build, in case there you've done a previous build with the same compiler/configuration, Cross Builder automatically compares your current build to that.

Finally, in case you want to do a build, and then do some pretty big modifications that could impact compilation size, you can "pin" this build. Then, further builds with this compiler/configuration will automatically be compared to this build.



Built using win32gui

Yes, you've guessed. Cross Builder has been built on top of win32gui library. I will also post the code for the initial version of Cross Builder very soon.



Source Code

Source Code for Cross Builder is now available. Just download the win32gui library (v1.6.2+), and you'll find it in:



Future steps

In case you think there's plenty to do ahead, you're completely right. Here's just the beginning:

  • Monitoring for build times (per directory/per project/per compiler/per config). Allow comparing build times (what if I apply setting A and B? How will this affect compilation time?)
  • Source-Control friendly
  • Allow for creating sub-compilers and sub-configurations. You'll be able to create your own sub-compilers/sub-configurations. Very useful when you want to test how your program behaves if some settings are specified, but aren't sure if these changes should be permanent (or, you have a project under source control).
  • Allow for parameters. Parameters are values that are configurable by the one that builds the project(s), but are unknown to the author of the project. The best example is "BOOST PATH" (the path to your boost installation).
  • Allow for more compilers than now (Intel, other versions of GCC, Borland, etc.)
  • Allow for Debugging
  • Redirections: allow from a directory, to be automatically redirected to another one. Very useful for "Gallery"-like directories (directories that hold utility functions/classes)
  • Importing/Exporting settings
  • Error file/line recognition: In case building with a compiler fails for a given file, show errors in a list. Allow showing the file in a friendly editor.


Requirements/ Compilers it works for

In order to use Cross Builder the system requirements are:

  • Windows 2000+
  • 5 Mb of disk space

It currently works for

  • MSVC 6
  • MSVC 7.1
  • MSVC 8
  • gcc 3.3
  • gcc 3.4.2 (not fully tested)
  • como/ VC6
  • como/ VC7.1

Of course, I plan to add as many compilers as possible, and I will do so, as I will have the time. Also, if your favorite compiler is not here, and you have some spare time and want to help, please contact me by email.