[odb-users] Compilation issue with gcc

Pierre-Olivier Rocher trynitron at gmail.com
Wed Jun 8 09:37:46 EDT 2016


Hi Boris,

I tried your trick, without success... But I finally found my issue. It was
a macro problem, in a header file. For some reason, the macro was already
defined, the code source was ignored !!!

A solution to avoid this kind of problem is to use #pragma once, and not
#ifndef #def #endif

Pierre-Olivier

2016-06-03 17:48 GMT+02:00 Boris Kolpackov <boris at codesynthesis.com>:

> Hi Pierre-Olivier,
>
> Pierre-Olivier Rocher <trynitron at gmail.com> writes:
>
> > template<typename T>
> > inline bool data<T>::erase(const int fm_id)
> > {
> >    m_database->erase<T>(fm_id);
>
> Try to add template after ->:
>
> m_database->template erase<T>(fm_id);
>
>
> > [...]
> >
> > #pragma db id auto
> > unsigned long m_id;
>
> While this should work, note that long could be longer than int
> which means you may get incorrect result for sufficiently large
> ids.
>
> Boris
>


More information about the odb-users mailing list