Eroare sursa

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
C.Marius
Nivel 4

Nivel 4
Mesaje: 689
Membru din: 28 Sep 2014, 16:21
Server: orice
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 1027  
 Contact:
Medalii

Sal, am si eu eroarea asta si nu stiu cum sa rezolv:
gmake: *** [OBJDIR/questlua_global.o] Error 1
root@localhost:/usr/src/mainline/Srcs/Server/game/src # gmake
Derleniyor.. questlua_global.cpp
questlua_global.cpp: In function 'int quest::_mysql_direct_query(lua_State*)':
questlua_global.cpp:1375:30: error: 'DBManager' has not been declared
std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(lua_tostring(L, 1)));
^
gmake: *** [OBJDIR/questlua_global.o] Error 1
Avatar utilizator
Hanzo.
Utilizator interzis !

Utilizator interzis !
Mesaje: 263
Membru din: 30 Aug 2014, 02:33
Regat: Jinno
Aprecieri: 93  
Mulţumiri: 25  
Medalii

Ce ai incercat să faci?
Imagine
Afișează semnătura
Avatar utilizator
C.Marius
Nivel 4

Nivel 4
Mesaje: 689
Membru din: 28 Sep 2014, 16:21
Server: orice
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 1027  
 Contact:
Medalii

Sa bag un sistem.acesta e codul adaugat in plus:
int _mysql_direct_query(lua_State* L)
{
// char szQuery[1024];

if (!lua_isstring(L, 1))
return 0;
// strncpy(szQuery, lua_tostring(L, 1), sizeof(szQuery));

int i=0, m=1;
MYSQL_ROW row;
MYSQL_FIELD * field;
MYSQL_RES * result;
// SQLMsg * pMsg = DBManager::instance().DirectQuery(szQuery);
std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(lua_tostring(L, 1)));
if (pMsg.get())
{
// ret1 (number of affected rows)
lua_pushnumber(L, pMsg->Get()->uiAffectedRows);
//-1 if error such as duplicate occurs (-2147483648 via lua)
// if wrong syntax error occurs (4294967295 via lua)
// ret2 (table of affected rows)
lua_newtable(L);
if ((result = pMsg->Get()->pSQLResult) &&
!(pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1))
{
// LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
// ch->ChatPacket(CHAT_TYPE_INFO, "<%s> Retrieved %u fields\n", __FUNCTION__, mysql_num_fields(result));
// ch->ChatPacket(CHAT_TYPE_INFO, "<%s> Retrieved %u rows\n", __FUNCTION__, mysql_num_rows(result));
// ch->ChatPacket(CHAT_TYPE_INFO, "<%s> Affected %u rows\n", __FUNCTION__, pMsg->Get()->uiAffectedRows);
// ch->ChatPacket(CHAT_TYPE_INFO, "<%s> Num %u rows\n", __FUNCTION__, pMsg->Get()->uiNumRows);

while((row = mysql_fetch_row(result)))
{
lua_pushnumber(L, m);
lua_newtable(L);
while((field = mysql_fetch_field(result)))
{
lua_pushstring(L, field->name);
if (!(field->flags & NOT_NULL_FLAG) && (row==NULL))
{
// lua_pushstring(L, "NULL");
lua_pushnil(L);
}
else if (IS_NUM(field->type))
{
double val = NAN;
lua_pushnumber(L, (sscanf(row,"%lf",&val)==1)?val:NAN);
}
else if (field->type == MYSQL_TYPE_BLOB)
{
lua_newtable(L);
for (DWORD iBlob=0; iBlob < field->max_length; iBlob++)
{
lua_pushnumber(L, row[iBlob]);
lua_rawseti(L, -2, iBlob+1);
}
}
else
lua_pushstring(L, row);
// LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
// ch->ChatPacket(CHAT_TYPE_INFO, "<%s> Retrieved %d flag %s for %s\n", __FUNCTION__, field->type, field->name, row?row:"NULL");
lua_rawset(L, -3);
i++;
}
mysql_field_seek(result, 0);
i=0;

lua_rawset(L, -3);
m++;
}
}
}
else {lua_pushnumber(L, 0); lua_newtable(L);}


Din ce imi du eu seama trb declarat DBManager da nu stiu cum?
Avatar utilizator
Hanzo.
Utilizator interzis !

Utilizator interzis !
Mesaje: 263
Membru din: 30 Aug 2014, 02:33
Regat: Jinno
Aprecieri: 93  
Mulţumiri: 25  
Medalii

adaugă #include "db.h" și vezi dacă merge.
Imagine
Afișează semnătura
Avatar utilizator
C.Marius
Nivel 4

Nivel 4
Mesaje: 689
Membru din: 28 Sep 2014, 16:21
Server: orice
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 1027  
 Contact:
Medalii

este deja pus
Avatar utilizator
C.Marius
Nivel 4

Nivel 4
Mesaje: 689
Membru din: 28 Sep 2014, 16:21
Server: orice
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 1027  
 Contact:
Medalii

Am rezolvat cu acela fisiere, acum am aceasta pb:
In file included from ../../../Extern/include/cryptopp/modes.h:8:0,
from cipher.cpp:7:
../../../Extern/include/cryptopp/secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer CryptoPP::AllocatorWithCleanup<T, T_Align16>::allocate(CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type, const void*) [with T = unsigned char; bool T_Align16 = false; CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer = unsigned char*; CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned int]':
../../../Extern/include/cryptopp/secblock.h:247:25: required from 'CryptoPP::SecBlock<T, A>::SecBlock(CryptoPP::SecBlock<T, A>::size_type) [with T = unsigned char; A = CryptoPP::AllocatorWithCleanup<unsigned char>; CryptoPP::SecBlock<T, A>::size_type = unsigned int]'
../../../Extern/include/cryptopp/algparam.h:17:2: required from here
../../../Extern/include/cryptopp/secblock.h:91:14: error: 'CheckSize' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
CheckSize(n);
^
../../../Extern/include/cryptopp/secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase<unsigned char>' are not found by unqualified lookup
../../../Extern/include/cryptopp/secblock.h:91:14: note: use 'this->CheckSize' instead
../../../Extern/include/cryptopp/secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer CryptoPP::AllocatorWithCleanup<T, T_Align16>::allocate(CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type, const void*) [with T = unsigned char; bool T_Align16 = true; CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer = unsigned char*; CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned int]':
../../../Extern/include/cryptopp/secblock.h:247:25: required from 'CryptoPP::SecBlock<T, A>::SecBlock(CryptoPP::SecBlock<T, A>::size_type) [with T = unsigned char; A = CryptoPP::AllocatorWithCleanup<unsigned char, true>; CryptoPP::SecBlock<T, A>::size_type = unsigned int]'
../../../Extern/include/cryptopp/modes.h:63:34: required from here
../../../Extern/include/cryptopp/secblock.h:91:14: error: 'CheckSize' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../../../Extern/include/cryptopp/secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase<unsigned char>' are not found by unqualified lookup
../../../Extern/include/cryptopp/secblock.h:91:14: note: use 'this->CheckSize' instead
../../../Extern/include/cryptopp/secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer CryptoPP::AllocatorWithCleanup<T, T_Align16>::allocate(CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type, const void*) [with T = unsigned int; bool T_Align16 = true; CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer = unsigned int*; CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned int]':
../../../Extern/include/cryptopp/secblock.h:249:29: required from 'CryptoPP::SecBlock<T, A>::SecBlock(const CryptoPP::SecBlock<T, A>&) [with T = unsigned int; A = CryptoPP::AllocatorWithCleanup<unsigned int, true>]'
../../../Extern/include/cryptopp/modarith.h:122:20: required from here
../../../Extern/include/cryptopp/secblock.h:91:14: error: 'CheckSize' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../../../Extern/include/cryptopp/secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase<unsigned int>' are not found by unqualified lookup
../../../Extern/include/cryptopp/secblock.h:91:14: note: use 'this->CheckSize' instead
../../../Extern/include/cryptopp/secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer CryptoPP::AllocatorWithCleanup<T, T_Align16>::allocate(CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type, const void*) [with T = unsigned int; bool T_Align16 = false; CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer = unsigned int*; CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned int]':
../../../Extern/include/cryptopp/secblock.h:247:25: required from 'CryptoPP::SecBlock<T, A>::SecBlock(CryptoPP::SecBlock<T, A>::size_type) [with T = unsigned int; A = CryptoPP::AllocatorWithCleanup<unsigned int>; CryptoPP::SecBlock<T, A>::size_type = unsigned int]'
../../../Extern/include/cryptopp/rc5.h:22:27: required from 'CryptoPP::BlockCipherFinal<DIR, BASE>::BlockCipherFinal() [with CryptoPP::CipherDir DIR = (CryptoPP::CipherDir)0u; BASE = CryptoPP::RC5::Enc]'
../../../Extern/include/cryptopp/misc.h:82:7: required from 'CryptoPP::CipherModeFinalTemplate_CipherHolder<CIPHER, BASE>::CipherModeFinalTemplate_CipherHolder(const byte*, size_t, const byte*) [with CIPHER = CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0u, CryptoPP::RC5::Enc>; BASE = CryptoPP::ConcretePolicyHolder<CryptoPP::Empty, CryptoPP::AdditiveCipherTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::AdditiveCipherAbstractPolicy, CryptoPP::CTR_ModePolicy> > >; byte = unsigned char; size_t = unsigned int]'
cipher.cpp:88:64: required from 'CryptoPP::SymmetricCipher* BlockCipherDetail<T>::CreateEncoder(const byte*, size_t, const byte*) const [with T = CryptoPP::RC5; byte = unsigned char; size_t = unsigned int]'
cipher.cpp:398:1: required from here
../../../Extern/include/cryptopp/secblock.h:91:14: error: 'CheckSize' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../../../Extern/include/cryptopp/secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase<unsigned int>' are not found by unqualified lookup
../../../Extern/include/cryptopp/secblock.h:91:14: note: use 'this->CheckSize' instead
gmake: *** [OBJDIR/cipher.o] Error 1
gmake: *** Waiting for unfinished jobs....
Avatar utilizator
Zerant :3
Nivel 4

Nivel 4
Mesaje: 723
Membru din: 17 Oct 2015, 12:53
Server: Velor2
Regat: Jinno
Aprecieri: 15  
Mulţumiri: 141  
Discord: Copiază ID
Medalii

Subiect vechi >> Arhivat
Închis
Răspunsuri
1
Vizualizări
131
Răspunsuri
4
Vizualizări
296
Răspunsuri
22
Vizualizări
1380
Răspunsuri
4
Vizualizări
640

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Semrush [Bot] și 127 vizitatori