[odb-users] need help

孙安 zju3080103798 at 163.com
Fri Jul 11 05:28:52 EDT 2014


I'm a user from china.I meet some problem when i use libodb. Here is the compile error:


g++ -g -DLINUX -std=gnu++11  -Wno-unknown-pragmas -Wno-deprecated  -I. -I./libev                         ent -I./libevent/include -I./protobuf/src -I./Common -I./Controller -I./log4cplu                         s-1.1.3-rc2/include -I./jsoncpp-src-0.5.0/include/ -I./OdbOutput/  ./main.o ./Co                         mmon/ProtoMsg.pb.o ./Common/CLogger.o ./Common/person.o ./Common/SocketClient.o                          ./Common/SocketEvent.o ./Common/SocketServerBase.o ./Common/SocketUser.o ./Commo                         n/SocketUserManager.o ./Common/TestClient.o ./Common/TestServer.o ./Common/TestT                         CPTask.o ./Common/Util.o ./Common/zMNetService.o ./Common/zService.o ./Common/zT                         CPTask.o ./Common/zTCPTaskPool.o ./Common/zThread.o ./Common/person-odb.o ./Cont                         roller/CustomDatabase.o ./Controller/GameServer.o ./Controller/GameUser.o ./Cont                         roller/OdbTemplate.o ./Controller/OdbUtil.o ./Controller/ProtoMsgHandle.o ./OdbO                         utput//Game-schema.o ./OdbOutput//ServerList-odb.o -lpthread -levent -lprotobuf                          -lmysqlcppconn -llog4cplus -ljson -lodb-mysql -lodb  -o MyFrame
./Controller/OdbUtil.o: In function `void odb::schema_catalog::data_migration_fu                         nction<2ull, 1ull>(odb::database_id, std::function<void (odb::database&)>, std::                         string const&)':
/usr/local/include/odb/schema-catalog.hxx:130: undefined reference to `odb::sche                         ma_catalog::data_migration_function(odb::database_id, unsigned long long, std::f                         unction<void (odb::database&)>, std::string const&)'
collect2: error: ld returned 1 exit status
make: *** [MyFrame] Error 1


Here is the source:
static void
migrate_gender (odb::database& db)
{
    DEBUG_MSG("migrate gender!");
    odb::transaction t (db.begin ());
    ServerList server;
    db.persist(server);
    t.commit ();
}


 odb::transaction t(m_db->begin());
    odb::schema_catalog::data_migration_function<2,1>(*m_db,migrate_gender);
    odb::schema_catalog::migrate(*m_db);
    t.commit();


I have troubled in this problem two days ,can you help me to solve this?


More information about the odb-users mailing list