[odb-users] Netbeans build error

Boris Kolpackov boris at codesynthesis.com
Wed Feb 16 01:20:29 EST 2011


Hi,

Bright Dadson <losintikfos at yahoo.co.uk> writes:

> I have attached a copy of the project.

I took a look at your makefiles, and I see you are running the ODB
compiler like this:

odb -d mysql --generate-query --generate-schema Member.cpp

The ODB compiler should be invoked on the header file that defines
the persistent classes, not the source file. So the above command
line should be:

odb -d mysql --generate-query --generate-schema Member.h

The other thing that I had to fix to make the resulting code compile
is to qualify the 'access' class in the friend declaration:

friend class odb::access;

If you just do :

namespace N
{
  using namespace odb;

  class Member 
  {
    friend class access;
  };
}

The C++ compiler assumes 'access' refers to a (yet undefined) class in 
namespace 'N'.

After these two changes I was able to compile your code without any
problems.

Boris



More information about the odb-users mailing list