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

Compiling ERROR compile Ubuntu 11.10

Ramallah

~Pepuz~
Joined
Mar 2, 2010
Messages
76
Reaction score
12
checking for main in -lboost_thread-gcc-mt... no
checking for main in -lboost_thread-mt... yes
checking for main in -lboost_regex-gcc-mt... no
checking for main in -lboost_regex-mt... yes
checking for main in -lboost_system-gcc-mt... no
checking for main in -lboost_system-mt... yes
checking for main in -lboost_date_time-gcc-mt... no
checking for main in -lboost_date_time-mt... yes
checking for main in -lboost_filesystem-gcc-mt... no


Login server mode........... : no
OTAdmin protocol............ : no
Root run permission......... : yes
Login server mode........... : no
Home-directory configuration : no
OTServ custom allocator..... : no
Debug build................. : no
Using LuaJIT................ : no
 
thanks mr EvulMastah for fast reply

on running : ./build.sh

make[1]: *** [luascript.o] Error 1
mv -f .deps/outfit.Tpo .deps/outfit.Po
mv -f .deps/movement.Tpo .deps/movement.Po
mv -f .deps/npc.Tpo .deps/npc.Po
mv -f .deps/party.Tpo .deps/party.Po
game.cpp: In constructor ‘Game::Game()’:
game.cpp:80:22: error: array subscript is above array bounds [-Werror=array-bounds]
game.h: In member function ‘void Game::globalSave()’:
game.h:623:76: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp: In member function ‘void Game::prepareGlobalSave()’:
game.cpp:6256:30: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp:6258:22: error: array subscript is above array bounds [-Werror=array-bounds]
cc1plus: all warnings being treated as errors

make[1]: *** [game.o] Error 1
mv -f .deps/player.Tpo .deps/player.Po
make[1]: Leaving directory `/home/trunk'
make: *** [all] Error 2

on running : make
---------------------------
game.cpp:6258:22: error: array subscript is above array bounds [-Werror=array-bounds]
cc1plus: all warnings being treated as errors

make[1]: *** [game.o] Error 1
make[1]: Leaving directory `/home/trunk'
make: *** [all] Error 2

-----------------------------------
 
didn't work for me


please check all my code :

root@cmd:/home# ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
root@cmd:/home/trunk#



root@cmd:/home/trunk# ./configure --enable-sqlite --enable-server-diag
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for ptrdiff_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for ceil... yes
checking for floor... yes
checking for ftime... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for memset... yes
checking for pow... yes
checking for sqrt... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strtol... yes
checking for xml2-config... /usr/bin/xml2-config
checking for libxml - version >= 2.6.5... yes (version 2.7.8)
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for main in -lz... yes
checking for main in -lboost_thread-gcc-mt... no
checking for main in -lboost_thread-mt... yes
checking for main in -lboost_regex-gcc-mt... no
checking for main in -lboost_regex-mt... yes
checking for main in -lboost_system-gcc-mt... no
checking for main in -lboost_system-mt... yes
checking for main in -lboost_date_time-gcc-mt... no
checking for main in -lboost_date_time-mt... yes
checking for main in -lboost_filesystem-gcc-mt... no
checking for main in -lboost_filesystem-mt... yes
checking boost/tr1/unordered_set.hpp usability... yes
checking boost/tr1/unordered_set.hpp presence... yes
checking for boost/tr1/unordered_set.hpp... yes
checking cryptopp/sha.h usability... yes
checking cryptopp/sha.h presence... yes
checking for cryptopp/sha.h... yes
checking cryptopp/md5.h usability... yes
checking cryptopp/md5.h presence... yes
checking for cryptopp/md5.h... yes
checking cryptopp/adler32.h usability... yes
checking cryptopp/adler32.h presence... yes
checking for cryptopp/adler32.h... yes
checking cryptopp/hex.h usability... yes
checking cryptopp/hex.h presence... yes
checking for cryptopp/hex.h... yes
checking cryptopp/base64.h usability... yes
checking cryptopp/base64.h presence... yes
checking for cryptopp/base64.h... yes
checking cryptopp/hmac.h usability... yes
checking cryptopp/hmac.h presence... yes
checking for cryptopp/hmac.h... yes
checking cryptopp/cryptlib.h usability... yes
checking cryptopp/cryptlib.h presence... yes
checking for cryptopp/cryptlib.h... yes
checking for main in -lcryptopp... yes
checking openssl/rsa.h usability... yes
checking openssl/rsa.h presence... yes
checking for openssl/rsa.h... yes
checking openssl/bn.h usability... yes
checking openssl/bn.h presence... yes
checking for openssl/bn.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking for main in -lcrypto... yes
checking for LUA... no
checking lua.hpp usability... yes
checking lua.hpp presence... yes
checking for lua.hpp... yes
checking for main in -llua... yes
checking sqlite3.h usability... yes
checking sqlite3.h presence... yes
checking for sqlite3.h... yes
checking for main in -lsqlite3... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands

theforgottenserver 0.4

Server diagnostics.......... : yes
Login server mode........... : no
OTAdmin protocol............ : no
Root run permission......... : no
Login server mode........... : no
Home-directory configuration : no
OTServ custom allocator..... : no
Debug build................. : no
Using LuaJIT................ : no

Build with MySQL............ : no
Build with SQLite........... : yes
Build with PostgreSQL....... : no

Configure complete, now you may type './build.sh'.


root@cmd:/home/trunk# ./build.sh
TheForgottenServer build script- seems to speed things up ALOT.
CCache: OK
CCache binaries located in /usr/lib/ccache
Building on 8 cores, using 9 processes
make all-am
make[1]: Entering directory `/home/trunk'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT databasesqlite.o -MD -MP -MF .deps/databasesqli
te.Tpo -c -o databasesqlite.o databasesqlite.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT game.o -MD -MP -MF .deps/game.Tpo -c -o game.o
game.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT luascript.o -MD -MP -MF .deps/luascript.Tpo -c
-o luascript.o luascript.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT monster.o -MD -MP -MF .deps/monster.Tpo -c -o m
onster.o monster.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT otserv.o -MD -MP -MF .deps/otserv.Tpo -c -o ots
erv.o otserv.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT position.o -MD -MP -MF .deps/position.Tpo -c -o
mv -f .deps/protocol.Tpo .deps/protocol.Po
monster.cpp: In member function ‘virtual void Monster::doAttacking(uint32_t)’:
monster.cpp:626:26: error: variable ‘outOfRange’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors

make[1]: *** [monster.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/protocolgame.Tpo .deps/protocolgame.Po
make[1]: Leaving directory `/home/trunk'
make: *** [all] Error 2
 
did this from make file

i found more errors



g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT game.o -MD -MP -MF .deps/game.Tpo -c -o game.o
game.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT luascript.o -MD -MP -MF .deps/luascript.Tpo -c
-o luascript.o luascript.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT monster.o -MD -MP -MF .deps/monster.Tpo -c -o m
onster.o monster.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT quests.o -MD -MP -MF .deps/quests.Tpo -c -o que
sts.o quests.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT raids.o -MD -MP -MF .deps/raids.Tpo -c -o raids
.o raids.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT scheduler.o -MD -MP -MF .deps/scheduler.Tpo -c
-o scheduler.o scheduler.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT scriptmanager.o -MD -MP -MF .deps/scriptmanager
.Tpo -c -o scriptmanager.o scriptmanager.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT server.o -MD -MP -MF .deps/server.Tpo -c -o ser
ver.o server.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -O2 -fomit-frame-pointer -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_S
AFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-unused-parameter -pipe -MT spawn.o -MD -MP -MF .deps/spawn.Tpo -c -o spaw

In file included from /usr/include/boost/filesystem/v3/config.hpp:29:0,
from /usr/include/boost/filesystem.hpp:34,
from luascript.cpp:21:
/usr/include/boost/system/api_config.hpp:28:5: error: #error user defined BOOST_POSIX_API or BOOST_WINDOWS_API not supported
In file included from /usr/include/boost/filesystem/v3/config.hpp:29:0,
from /usr/include/boost/filesystem.hpp:34,

make[1]: *** [monster.o] Error 1
make[1]: *** Waiting for unfinished jobs....
scriptmanager.cpp: In member function ‘bool ScriptManager::loadMods()’:
scriptmanager.cpp:130:23: error: ‘class boost::filesystem3::directory_entry’ has no member named ‘leaf’
mv -f .deps/scheduler.Tpo .deps/scheduler.Po
mv -f .deps/quests.Tpo .deps/quests.Po
mv -f .deps/spawn.Tpo .deps/spawn.Po
make[1]: *** [scriptmanager.o] Error 1
mv -f .deps/raids.Tpo .deps/raids.Po
make[1]: *** [luascript.o] Error 1
mv -f .deps/server.Tpo .deps/server.Po
game.cpp: In constructor ‘Game::Game()’:
game.cpp:80:22: error: array subscript is above array bounds [-Werror=array-bounds]
game.h: In member function ‘void Game::globalSave()’:
game.h:623:76: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp: In member function ‘void Game::prepareGlobalSave()’:
game.cpp:6256:30: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp:6258:22: error: array subscript is above array bounds [-Werror=array-bounds]
cc1plus: all warnings being treated as errors

make[1]: *** [game.o] Error 1
make[1]: Leaving directory `/home/trunk'
make: *** [all] Error 2
 
Replace std::string s = it->leaf(); with std::string s = it->path().filename();
If its still gonna throw errors - std::string s = it->path().filename().string();
 
Code:
scriptmanager.cpp: In member function ‘bool ScriptManager::loadMods()’:
scriptmanager.cpp:130:23: error: ‘class boost::filesystem3::directory_entry’ has no member named ‘leaf’
 
thanks
i did the both

mv -f .deps/tile.Tpo .deps/tile.Po
game.cpp: In constructor ‘Game::Game()’:
game.cpp:80:22: error: array subscript is above array bounds [-Werror=array-bounds]
game.h: In member function ‘void Game::globalSave()’:
game.h:623:76: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp: In member function ‘void Game::prepareGlobalSave()’:
game.cpp:6256:30: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp:6258:22: error: array subscript is above array bounds [-Werror=array-bounds]
cc1plus: all warnings being treated as errors

make[1]: *** [game.o] Error 1
make[1]: Leaving directory `/home/trunk'
make: *** [all] Error 2

i found this

is there any source file clean from all that errors please help fixling
 
Already told you what to do with it. Go to prepareGlobalSave() in game.cpp and see which variable is going out of bounds, find its declaration in game.h and adjust its size.
 
yep i found it
game.cpp

int32_t prepareHour = g_config.getNumber(ConfigManager::GLOBALSAVE_H),
prepareMinute = g_config.getNumber(ConfigManager::GLOBALSAVE_M) - 5,
hoursLeft = 0, minutesLeft = 0;
if(theTime->tm_hour > prepareHour)
{
hoursLeft = 23 - (theTime->tm_hour - prepareHour);
if(theTime->tm_min > prepareMinute)
{
minutesLeft = 60 - (theTime->tm_min - prepareMinute);
hoursLeft--;
}
else if(theTime->tm_min != prepareMinute)
minutesLeft = prepareMinute - theTime->tm_min;
}
else if(theTime->tm_hour == prepareHour)
{
if(theTime->tm_min > (prepareMinute - 1) && theTime->tm_min < (prepareMinute + 6))
{
if(theTime->tm_min > (prepareMinute + 1))
setGlobalSaveMessage(0, true);

if(theTime->tm_min > (prepareMinute + 3))
setGlobalSaveMessage(1, true);

prepareGlobalSave();
}
else if(theTime->tm_min > prepareMinute)
{
minutesLeft = 60 - (theTime->tm_min - prepareMinute);
hoursLeft = 23;
}
else
minutesLeft = prepareMinute - theTime->tm_min;
}
else
{
hoursLeft = prepareHour - theTime->tm_hour;
if(theTime->tm_min > prepareMinute)
{
minutesLeft = 60 - (theTime->tm_min - prepareMinute);
hoursLeft--;
}
else if(theTime->tm_min != prepareMinute)
minutesLeft = prepareMinute - theTime->tm_min;
}

if(!hoursLeft || !minutesLeft)
return;

uint32_t timeLeft = (hoursLeft * 3600000) + minutesLeft * 60000;
saveEvent = Scheduler::getInstance().addEvent(createSchedulerTask(timeLeft,
boost::bind(&Game::prepareGlobalSave, this)));
}



game.h

virtual ~Game();
void start(ServiceManager* servicer);

Highscore getHighscore(uint16_t skill);
std::string getHighscoreString(uint16_t skill);
void checkHighscores();
bool reloadHighscores();

bool isSwimmingPool(Item* item, const Tile* tile, bool checkProtection) const;

void prepareGlobalSave();
void globalSave();

- - - Updated - - -

don't know how to edit please help fix
 

Similar threads

Back
Top