• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Zmiana int32 - 64

mldo

New Member
Joined
Jun 29, 2014
Messages
36
Reaction score
0
Witam, mam problem przy kompilacji, mianowicie wyleciał mi błąd:

Code:
../luascript.cpp: In member function `virtual void LuaInterface::registerFunctions()':
../luascript.cpp:1406: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1406: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'

Błędów jest kilka, podobna struktura, tylko do czego innego odwołanie. Nie mam pojęcia gdzie leży przyczyna, może mnie nakierujecie, lub znacie podobny przypadek

Kompilacja trunk.r3884, powiększenie wartości z int32 do int64.
 
Last edited:
bo funkcja lua_pushcclosure oczekuje w argumencie drugim inta a nie int64. Po prostu twoj kod jest niekompletny. Plus moglbys wiecej informacji podac, co robisz itp.
 
Zwiększam życie, mane, obrażenia w silniku z int32 do 64. Potworek/Gracz
Lina przykładowa: 1406
C++:
    //getCreatureHealth(cid)
    lua_register(m_luaState, "getCreatureHealth", LuaInterface::luaGetCreatureHealth);

    //getCreatureMaxHealth(cid[, ignoreModifiers = false])
    lua_register(m_luaState, "getCreatureMaxHealth", LuaInterface::luaGetCreatureMaxHealth);

    //getCreatureMana(cid)
    lua_register(m_luaState, "getCreatureMana", LuaInterface::luaGetCreatureMana);

    //getCreatureMaxMana(cid[, ignoreModifiers = false])
    lua_register(m_luaState, "getCreatureMaxMana", LuaInterface::luaGetCreatureMaxMana);
(...) w sumie 11 odczytów
Pozmieniane jest tam gdzie znalazłem, nadal nie znalazłem przyczyny
 
Last edited:
wydaje mi się, że musisz zmienić w kompilatorze wersje lua na wyższą.
Znalazłem coś takiego w lua.h:
C++:
typedef int (*lua_CFunction) (lua_State *L);
LUA_API void  (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
Chyba dopiero od lua 5.3 można używać int64.
Jeśli się mylę proszę mnie poprawić.
 
Nie dodawałem jeszcze nigdy biblioteki lua, i mam nie lada problem z tym, jest poradnik, lub wyjaśnił byś mi w kilku krokach jak to poprawnie dodać? Puki co mam więcej błędów niż miałem wcześniej.

PS: jest lua 5.1, ktoś wie do jakiej wartości sięga lua 5.3?
 
Nadal nie znalazłem przyczyny błędu:
Code:
../luascript.cpp: In member function `virtual void LuaInterface::registerFunctions()':
../luascript.cpp:1406: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1406: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:1409: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1409: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:1412: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1412: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:1415: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1415: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:1984: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1984: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:1987: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1987: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:1993: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1993: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:1999: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:1999: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:2002: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:2002: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:2005: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:2005: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
../luascript.cpp:2008: error: invalid conversion from `int64_t (*)(lua_State*)' to `int (*)(lua_State*)'
../luascript.cpp:2008: error:   initializing argument 2 of `void lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
make.exe: *** [obj//luascript.o] Error 1
Męczę to od kilku dni, i kicha. @Lukanio, skoro to nie to, to co? Dajcie mi plik, myśl, co bym mógł poszukać.
 
Back
Top