[odb-users] Error creating multi-database query support code with objects containing composite values in Visual Studio 2010/2013 (MSVC)

Boris Kolpackov boris at codesynthesis.com
Wed Jan 22 03:58:16 EST 2014


Hi Harald,

Harald Frostel <Harald.Frostel at jku.at> writes:

> I use the same export/extern macros as with the dynamic multi-database
> shared library (common layer).
>  
> template <typename A>
> struct query_columns< ::ACompositeObject, id_sqlite, A >
> {
>     struct MODEL_EXPORT id_type_ // WAS: struct id_type_

You need to use a separate set of export/extern macros for each DLL
that you create. That is, you would have MODEL_EXPORT for the common
interface, MODEL_SQLITE_EXPORT for the SQLite implementation,
MODEL_MYSQL_EXPORT for MySQL, etc.

When you are building the SQLite implementation DLL, MODEL_EXPORT
should be set to import while MODEL_SQLITE_EXPORT to export. When
building your application, both MODEL_EXPORT and MODEL_SQLITE_EXPORT
should be set to import.

Can you check this and let me know whether this was the problem?

Boris



More information about the odb-users mailing list