• 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!

Błąd podczas Kompilacji Silnika.

Dark Magican

Batory 7.72 - map developer.
Joined
Jun 30, 2009
Messages
34
Reaction score
17
Location
Legnica
Witam, dziś dodałem pewien skrypt, do silnika Kentana 1.0 - i mam problem, otóż pobrałem sporo bibliotek, te które ludzie kazali lecz nadal mam jakieś błędy.

Kompilator: Default compiler
Building Makefile: "E:\Projekt\DUPA\Kentana Engine 1.0\source\Makefile.win"
Wykonywanie make...
make.exe -f "E:\Projekt\DUPA\Kentana Engine 1.0\source\Makefile.win" all
g++.exe -c Pliki/actions.cpp -o Obj/actions.o -I"C:/Documents and Settings/Administrator/Pulpit/Nowy folder/The Forgotten Dev-Cpp/include" -DHUCZU_FOLLOW -DHUCZU_LOOT_INFO -DHUCZU_EXHAUSTED -DHUCZU_SKULLS -DHUCZU_BAN_SYSTEM -DHUCZU_MEGAMANAS -DYUR_CVS_MODS -DYUR_LOGIN_QUEUE -DYUR_BOH -DYUR_PVP_ARENA -DYUR_RINGS_AMULETS -DYUR_READABLES -DYUR_HIGH_LEVELS -DYUR_PREMIUM_PROMOTION -D_NG_BBK_SPAMSPELL__ -D_NG_BBK_PVP__ -D__KIRO_AKT__ -DTLM_HOUSE_SYSTEM -DTRS_GM_INVISIBLE -DCVS_DAY_CYCLE -DFIXY -fexpensive-optimizations -O3

Pliki/actions.cpp: In constructor `ActionScript::ActionScript(Game*, const std::string&, const std::string&)':

Pliki/actions.cpp:507: error: `luaopen_loadlib' was not declared in this scope

Pliki/actions.cpp:512: error: `lua_dofile' was not declared in this scope

make.exe: *** [Obj/actions.o] Error 1

Wykonanie zakończone

Zdjęcie z Package Managera:

60608159558169147657.jpg
 
Mogłeś omyłkowo nie dołączyć wszystkich wymaganych nagłówków w plikach źródłowych
albo...
Pliki/actions.cpp:507: error: `luaopen_loadlib' was not declared in this scope
Częściowa odpowiedź. Cytat poniżej:
  • Subject: Re: luaopen_loadlib in 5.1?
  • From: Luiz Henrique de Figueiredo <lhf@...>
  • Date: Sun, 11 Sep 2005 21:21:38 -0300
> I am starting to port to 5.1 alpha and I have run across a missing
> function, luaopen_loadlib(). I am calling this with all my other library
> loads because I found some example code that does it.

Try luaopen_package. If you want to open all standard Lua libraries,
call luaL_openlibs.
--lhf
Prawdopodobnie używasz niewłaściwej wersji biblioteki, w której usunięto część funkcji lub/i zmieniono ich nazwy. Wygląda na to, że twórcy tej biblioteki zamiast zwiększyć numer głównej wersji z 5.x do 6.x - aby nie było zamieszania w przypadku zerwania kompatybilności wstecznej - zwiększają na razie tylko podwersje 5.Y.
 
Last edited:
Dziękuję troszkę pomogłeś, udało mi się usunąć błąd z actions.cpp niestety, błąd z make.exe został nadal oraz to, że nie ma plików .dll .

Compiler: Default compiler
Building Makefile: "E:\Projekt\DUPA\Kentana Engine 1.0\source\Makefile.win"
Executing make...
make.exe -f "E:\Projekt\DUPA\Kentana Engine 1.0\source\Makefile.win" all
windres.exe -i Test_private.rc --input-format=rc -o Obj/Test_private.res -O coff

g++.exe Obj/account.o Obj/actions.o Obj/allocator.o Obj/chat.o Obj/commands.o Obj/container.o Obj/creature.o Obj/exception.o Obj/fileloader.o Obj/game.o Obj/guilds.o Obj/houses.o Obj/ioaccount.o Obj/ioaccountxml.o Obj/iomapotbm.o Obj/ioplayer.o Obj/ioplayerxml.o Obj/item.o Obj/itemloader.o Obj/items.o Obj/logger.o Obj/loginqueue.o Obj/luascript.o Obj/magic.o Obj/map.o Obj/monster.o Obj/monsters.o Obj/networkmessage.o Obj/npc.o Obj/otserv.o Obj/player.o Obj/position.o Obj/protocol.o Obj/protocol76.o Obj/pvparena.o Obj/readables.o Obj/scheduler.o Obj/spawn.o Obj/spells.o Obj/status.o Obj/thing.o Obj/tile.o Obj/tools.o Obj/Test_private.res -o "KentanaOTS.exe" -L"C:/Dev-Cpp/lib" -L"C:/Program Files/Dev-Cpp/bin" -L"C:/Program Files/Dev-Cpp/others/lua-5.0.2/lib" -L"C:/Program Files/Dev-Cpp/lib" -lwsock32 -llibboost_regex-mgw-mt-s-1_33_1 C:/Program Files/Dev-Cpp/bin/libxml2.dll C:/Program Files/Dev-Cpp/bin/lua5.dll C:/Program Files/Dev-Cpp/bin/lualib5.dll

g++.exe: C:/Program: No such file or directory

g++.exe: Files/Dev-Cpp/bin/libxml2.dll: No such file or directory
g++.exe: C:/Program: No such file or directory
g++.exe: Files/Dev-Cpp/bin/lua5.dll: No such file or directory
g++.exe: C:/Program: No such file or directory
g++.exe: Files/Dev-Cpp/bin/lualib5.dll: No such file or directory

make.exe: *** [KentanaOTS.exe] Error 1

Execution terminated

Tutaj na zdjęciu widać, że wszystko jest dobrze wypełnione.

69647771999576319570.jpg


Pozdrawiam.
 
g++.exe: C:/Program: No such file or directory

g++.exe: Files/Dev-Cpp/bin/libxml2.dll: No such file or directory
g++.exe: C:/Program: No such file or directory
g++.exe: Files/Dev-Cpp/bin/lua5.dll: No such file or directory
g++.exe: C:/Program: No such file or directory
g++.exe: Files/Dev-Cpp/bin/lualib5.dll: No such file or directory
Popraw mnie jeżeli się mylę, ale wygląda na to, że g++.exe ma problem ze ścieżkami, w których znajdują się spacje. Sugeruje to jeden z błędów (zwróć uwagę na ścieżkę - "C:/Program" zamiast poprawnej "C:/Program Files/"):
g++.exe: C:/Program: No such file or directory
Oraz następne - ścieżki "Files/Dev-Cpp/*" zamiast "C:/Program Files/Dev-Cpp/*":
g++.exe: Files/Dev-Cpp/bin/libxml2.dll: No such file or directory
g++.exe: C:/Program: No such file or directory
g++.exe: Files/Dev-Cpp/bin/lua5.dll: No such file or directory
g++.exe: C:/Program: No such file or directory
g++.exe: Files/Dev-Cpp/bin/lualib5.dll: No such file or directory
Rozwiązaniem może być:
  1. odinstalowanie programu oraz jego ponowna instalacja w lokalizacji, w której nie występują w nazwach folderów spacje np. C:/Dev-Cpp , co zapewne jest domyślną ścieżką instalatora programu, którą najpewniej zmieniłeś,
  2. przeniesienie bibliotek do lokalizacji, w której nie występują w nazwach folderów spacje. Tego rozwiązania nie polecam, choć może być nieco szybsze.
Zalecam pierwsze rozwiązanie.
 
Last edited:
Okej, zrobiłem to co mi podpowiedzialeś - zupełny banał, nic skomplikowanego a ja się męczę i męczę. Teraz, mam taki błąd:

Compiler: Default compiler
Building Makefile: "E:\Projekt\DUPA\ots\source\devcpp\Makefile.win"
Executing make...
make.exe -f "E:\Projekt\DUPA\ots\source\devcpp\Makefile.win" all
g++.exe -c ../actions.cpp -o obj/actions.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include" -DEXCEPTION_TRACER -DTLM_BUY_SELL -DTLM_SERVER_SAVE -DTLM_HOUSE_SYSTEM -DBDB_UTEVO_LUX -DWOLV_LOAD_NPC -DBD_HOUSE_WINDOW -DTR_ANTI_AFK -DELEM_VIP_LIST -DTR_SUMMONS -DTRS_GM_INVISIBLE -DTLM_SKULLS_PARTY -DBRN_EXIVA -DSD_BURST_ARROW -DBDB_REPLACE_SPEARS -DBD_ITEM_LOOK -DSM_RELOAD_CONFIG -DJD_DEATH_LIST -DCT_EXANI_TERA -DCVS_DAY_CYCLE -DTJ_MONSTER_BLOOD -DJD_WANDS -D__DEBUG_PLAYERS__ -DYUR_CVS_MODS -DYUR_ICE_RAPIER -DYUR_AOL -DYUR_LOGIN_QUEUE -DYUR_MULTIPLIERS -DYUR_BOH -DYUR_NPC_EXT -DYUR_GUILD_SYSTEM -DYUR_CMD_EXT -DYUR_ITEM_EXT -DYUR_ACT_EXT -DYUR_NO_MONSTER_HEAL -DYUR_PVP_ARENA -DYUR_RINGS_AMULETS -DYUR_CONFIG_CAP -DYUR_FIGHT_MODE -DYUR_READABLES -DYUR_LEARN_SPELLS -DYUR_HEAL_EXHAUST -DYUR_SHUTDOWN -DYUR_ROOKGARD -DYUR_LIGHT_ITEM -DYUR_CLEAN_MAP -DYUR_GM_LOOK -DYUR_HIGH_LEVELS -DYUR_PREMIUM_PROMOTION -DYUR_INVISIBLE -DYUR_DRAINS -DYUR_BUILTIN_AAC -fexpensive-optimizations -O3

../actions.cpp:1798:1: unterminated #ifdef

make.exe: *** [obj/actions.o] Error 1

Execution terminated
 
actions.cpp:1798:1: unterminated #ifdef
Akurat ten błąd mogłeś znaleźć w Google ;) Dotyczy nie zamknięcia dyrektywy #ifdef preprocesora dyrektywą #endif w danym pliku nagłówkowym. W poniższy sposób tworzy się warunek dla preprocesora:
Code:
#ifdef JAKAS_STALA // warunek
    // Jeżeli JAKAS_STALA istnieje zrób coś tam
#endif // zakończenie warunku - zamknięcie dyrektywy
i wygląda na to, że u Ciebie w pliku actions.cpp brakuje #endif. Tutaj możesz przeczytać co nieco na temat dyrektyw preprocesora w językach C/C++.

Podpowiedź: Liczba 1798 prawdopodobnie dotyczy nr linijki kodu, natomiast 1 zapewne wiersza, w którym znaleziono błąd.
 
Last edited:
Jeśli nie będziesz umiał sobie poradzić z tym problemem, wrzuć plik actions.cpp lub też jego fragment. Postaram się to naprawić :)
 
Code:
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h: At global scope:

C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h: In instantiation of `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep_base':
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:152:  instantiated from `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:1970:  instantiated from `std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
../account.cpp:10:  instantiated from here

C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:146: error: invalid use of undefined type `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/stringfwd.h:49: error: declaration of `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:147: error: invalid use of undefined type `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/stringfwd.h:49: error: declaration of `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h: In instantiation of `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep':
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:1970:  instantiated from `std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
../account.cpp:10:  instantiated from here
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:154: error: invalid use of undefined type `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/stringfwd.h:49: error: declaration of `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.tcc:61: error: no type named `size_type' in `struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.tcc:78: error: no type named `size_type' in `struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.tcc:464: error: invalid use of undefined type `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/stringfwd.h:49: error: declaration of `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.tcc:550: error: invalid use of undefined type `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/stringfwd.h:49: error: declaration of `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h: In constructor `std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]':
../account.cpp:10:  instantiated from here
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:1970: error: invalid use of undefined type `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/stringfwd.h:49: error: declaration of `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h: In destructor `std::basic_string<_CharT, _Traits, _Alloc>::~basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]':
../account.cpp:10:  instantiated from here
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:414: error: invalid use of undefined type `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/stringfwd.h:49: error: declaration of `struct std::allocator<char>'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h: In member function `_Alloc std::basic_string<_CharT, _Traits, _Alloc>::get_allocator() const [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]':
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:414:  instantiated from `std::basic_string<_CharT, _Traits, _Alloc>::~basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
../account.cpp:10:  instantiated from here
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:1467: error: return type `struct std::allocator<char>' is incomplete
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:1467: error: conversion from `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider' to non-scalar type `std::allocator<char>' requested
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h: In static member function `static std::basic_string<_CharT, _Traits, _Alloc>::_Rep& std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]':
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:332:  instantiated from `static std::basic_string<_CharT, _Traits, _Alloc>::_Rep& std::basic_string<_CharT, _Traits, _Alloc>::_S_empty_rep() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:1970:  instantiated from `std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
../account.cpp:10:  instantiated from here
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_string.h:178: error: no type named `size_type' in `struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >'

make.exe: *** [obj/account.o] Error 1

Execution terminated
[/QUOTE]


Podczas dodawania Systemu Tasków, mam takie błędy - próbuje już 10 raz, według poradnika i cały czas to samo.
 
Cały czas jest to samo. Dodałem to co mówiłeś, cały czas ten sam błąd. Te błędy, które tutaj dodałem to tylko 1/4 z tych co mam w konsoli. Każdy odnosi się C++ 3.4.2 i account.cpp - nie wiem dlaczego tak się dzieje. btw. gdy nie dodam tego skryptu, kompilacja kończy się powodzeniem.
 
Popatrz, dodaje Task Sytem by Miziak : - > błędy jakie mi wychodzą:

Code:
In file included from ../game.cpp:62:
../task.h:1: error: expected constructor, destructor, or type conversion before numeric constant
../task.h:1: error: expected `,' or `;' before numeric constant

In file included from ../game.cpp:62:
../task.h:22:2: #endif without #if
../game.cpp: In member function `void GameState::onAttackedCreature(Tile*, Creature*, Creature*, int, bool)':
../game.cpp:556: error: `Tasks' has not been declared
../game.cpp:556: error: `isTaskMonster' undeclared (first use this function)
../game.cpp:556: error: (Each undeclared identifier is reported only once for each function it appears in.)
../game.cpp:561: error: `Tasks' has not been declared
../game.cpp:561: error: `getTaskStorage' undeclared (first use this function)
../game.cpp:562: error: `Tasks' has not been declared
../game.cpp:562: error: `getTaskCount' undeclared (first use this function)
../game.cpp:564: error: `Tasks' has not been declared

make.exe: *** [obj/game.o] Error 1

Execution terminated
 
Zacznij kurs C++, ponieważ ciągłe podawanie Ci odpowiedzi na błędy o tej samej przyczynie nie ma większego sensu. W dodatku zamiast podzielić się całym plikiem oraz wszystkimi błędami umieszczasz tylko kawałki co utrudnia rozwiązanie problemu.
 
Cześć, mam teraz inny problem z resztą sobie poradziłem.

na początku, pisze mi :

Code:
C:\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -llibboost_regex-mgw-mt-s-1_33_1
collect2: ld returned 1 exit status

make.exe: *** [ZareckiOt.exe] Error 1

Execution terminated

A gdy wkleję plik llibboost_regex-mgw-mt-s-1_33_1 mam takie błędy:

[Linker error] undefined reference to `boost::system::get_system_category()'

Code:
actions.o(.text+0x8981):actions.cpp: undefined reference to `boost::system::get_system_category()'
actions.o(.text+0x89a3):actions.cpp: undefined reference to `boost::system::get_generic_category()'

actions.o(.text+0x89c5):actions.cpp: undefined reference to `boost::system::get_generic_category()'
actions.o(.text+0x89e7):actions.cpp: undefined reference to `boost::system::get_generic_category()'
actions.o(.text+0x8a09):actions.cpp: undefined reference to `boost::system::get_system_category()'
actions.o(.text+0x8a2b):actions.cpp: undefined reference to `boost::system::get_system_category()'
actions.o(.text+0x8a4d):actions.cpp: undefined reference to `boost::system::get_system_category()'
actions.o(.text+0x8a6f):actions.cpp: undefined reference to `boost::system::get_system_category()'
actions.o(.text+0x8b19):actions.cpp: undefined reference to `boost::system::get_system_category()'
baseevents.o(.text+0x7341):baseevents.cpp: more undefined references to `boost::system::get_system_category()' follow
baseevents.o(.text+0x7363):baseevents.cpp: undefined reference to `boost::system::get_generic_category()'


To tylko pewna część tych błędów.
 
Back
Top