[odb-users] Building ODB compiler on Windows using VC++

Boris Kolpackov boris at codesynthesis.com
Fri Feb 13 05:16:33 EST 2015

Hi Edward,

Edward Diener <eldlistmailingz at tropicsoft.com> writes:

> How can I build the ODB compiler on Windows using Visual Studio ?

As soon as you can build GCC with Visual Studio ;-). I bet that
won't happen any time soon. (any why?)

> Although I have mingw and mingw64 I do not want to fool around with
> MSYS, but if using MSYS is the only way to build odb on Windows I
> will use that.

Yes, that's probably the most straightforward way to do it. The way
we do it is via a cross compiler from Linux, but that's quite

> Although I do not absolutely have to build the ODB compiler from
> source code I would like to keep up with source code changes using
> git and build the compiler from source code myself rather than
> install it.

First, a bit of background:

Internally, ODB is implemented as a GCC plugin. So, when you run
'odb', underneath it runs GCC which in turn runs a plugin which
does most of the work. This all works very smoothly on UNIX-like
platforms (e.g., Linux, Mac OS, Solaris) which have a sane dynamic
library/loading models. On Windows, however, GCC does not support
plugins since nobody managed to implement the dynamic loading
part yet. So what we do is apply a patch (a relatively small one,
considering what it does) to GCC to support a statically-linked
plugin. We then go ahead and link the ODB plugin statically into

All the scripts, patches, and instructions for doing this are publicly
available, so with enough determination you could probably build ODB
for Windows yourself:


The question is, of course, if it is worth the trouble. If you want
to use some feature that is only available in the repository, just
shout and I will gladly build you a pre-release pack of ODB. I do
this all the time:



More information about the odb-users mailing list