[odb-users] odb compiler and Windows SDK headers

Boris Kolpackov boris at codesynthesis.com
Thu Nov 28 09:21:04 EST 2019

ALAIN MARI <alain.mari at se.com> writes:

> But many of our classes have specific Windows types like VARIANT which
> are defined in Windows SDK include. These types concern only methods
> parameters types, not fields types that we want to persist. As odb
> compiler uses its own headers (mingw), is it safe to try to include
> Windows headers also ?

I think this should work for the commonly used stuff. In particular,
MinGW has a fairly complete Win32 API headers but more recent and/or
esoteric stuff (e.g., COM) is anyone's guess.

If you do run into issues, you can work around them by conditionally
excluding parts of your headers during ODB compilation with the
ODB_COMPILER macro. For example:

class object

  ... // Windows-specific stuff.


  ... // Data member.

It's not pretty but reliable.

More information about the odb-users mailing list