• 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 When I compiling

Sir Gabriiel

New Member
Joined
Mar 24, 2012
Messages
88
Reaction score
2
Good night,

Erro
When I ran the command

make clean && ./build.sh


Code:
mv -f .deps/iologindata.Tpo .deps/iologindata.Po
luascript.cpp: In static member function âstatic int32_t LuaInterface::luaGetTownTemplePosition(lua_State*)â:
luascript.cpp:9187:7: error: variable âdisplayErrorâ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
make[1]: *** [luascript.o] Error 1
mv -f .deps/mailbox.Tpo .deps/mailbox.Po
mv -f .deps/items.Tpo .deps/items.Po
make[1]: Leaving directory `/sources'
make: *** [all] Error 2

Does anyone know how to solve?
 
Warnings are being treated as errors, therefore even miniscule coding mishaps such as declaring variables and not using them, will count as critical "your program is horribly broken" errors, and thus stop the compilation process. You need to change the compile command so that warnings are not being treated as errors, most likely inside the "build.sh" file.
 
Warnings are being treated as errors, therefore even miniscule coding mishaps such as declaring variables and not using them, will count as critical "your program is horribly broken" errors, and thus stop the compilation process. You need to change the compile command so that warnings are not being treated as errors, most likely inside the "build.sh" file.

You could try to get to me?
Which file you need?


The build.sh is here

Code:
#!/bin/bash
# CCache + multicore compilation script by Stian
# For "The Forgotten Server"

# Example:
# # make clean
# # time ./build.sh

# Gives:
# real	3m27.070s
# user	6m4.066s
# sys	0m16.659s

# CCACHE recompile (from scratch):
# # make clean
# # time ./build.sh

# Gives:
# real	0m27.620s
# user	0m43.744s
# sys	0m4.766s

# 1/7 of the original compile time!
# When more you do it, more ccache will cache, default is limited to use 1GB storage

echo "TheForgottenServer build script- seems to speed things up ALOT."
# Enable CCache
if test -x `which ccache`; then
	echo "CCache: OK"
	if [ -f /usr/lib/ccache/bin ]; then
		export PATH=/usr/lib/ccache/bin/:$PATH
		echo "CCache binaries located in /usr/lib/ccache/bin"
	else
		export PATH=/usr/lib/ccache/:$PATH
		echo "CCache binaries located in /usr/lib/ccache"
	fi
else
	echo "CCache: Not installed"
fi

# Get number cores
CORES=`grep processor /proc/cpuinfo | wc -l`
# Set make processes - 1 + number of cores
MAKEOPT=$(($CORES + 1))

echo "Building on $CORES cores, using $MAKEOPT processes"
make -j $MAKEOPT

--UPDATE--

I tried again and had this error

Code:
make[1]: *** [otserv.o] Error 1
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:613:76: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp: In member function âvoid Game::prepareGlobalSave()â:
game.cpp:6138:30: error: array subscript is above array bounds [-Werror=array-bounds]
game.cpp:6140: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/npc.Tpo .deps/npc.Po
make[1]: Leaving directory `/sources'
make: *** [all] Error 2
 
Post the makefile (makefile.am I think).

Makefile.am(The file is in uppercase M)
Code:
noinst_PROGRAMS = theforgottenserver

CXXFLAGS = -pipe
AM_CXXFLAGS = $(XML_CPPFLAGS) $(OTSERV_FLAGS) $(LUA_CFLAGS) $(DEBUG_FLAGS)\
$(MYSQL_FLAGS) $(SQLITE_FLAGS) $(PGSQL_FLAGS) $(PROFILER_FLAGS)\
$(OPTIONAL_FLAGS) -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing

theforgottenserver_LDADD = $(LUA_LIBS)

if USE_MYSQL
MAYBE_MYSQL = databasemysql.cpp databasemysql.h
endif
if USE_SQLITE
MAYBE_SQLITE = databasesqlite.cpp databasesqlite.h
endif
if USE_PGSQL
MAYBE_PGSQL = databasepgsql.cpp databasepgsql.h
endif
if LOGIN_SERVER
MAYBE_LOGIN = gameservers.cpp gameservers.h
endif
if OT_ADMIN
MAYBE_OTADMIN = admin.cpp admin.h
endif

theforgottenserver_SOURCES = account.h actions.cpp actions.h $(MAYBE_OTADMIN) \
	allocator.cpp allocator.h baseevents.cpp baseevents.h beds.cpp \
	beds.h chat.cpp chat.h combat.cpp combat.h condition.cpp condition.h \
	config.h configmanager.cpp configmanager.h connection.cpp connection.h \
	const.h container.cpp container.h creature.cpp creature.h \
	creatureevent.cpp creatureevent.h cylinder.cpp cylinder.h database.cpp \
	database.h databasemanager.cpp databasemanager.h $(MAYBE_MYSQL) \
	$(MAYBE_SQLITE) $(MAYBE_PGSQL) depot.cpp depot.h dispatcher.cpp \
	dispatcher.h exception.cpp exception.h fileloader.cpp fileloader.h \
	game.cpp game.h $(MAYBE_LOGIN) globalevent.cpp globalevent.h group.cpp \
	group.h house.cpp house.h housetile.cpp housetile.h ioban.cpp ioban.h \
	ioguild.cpp ioguild.h iologindata.cpp iologindata.h iomap.cpp iomap.h \
	iomapserialize.cpp iomapserialize.h item.cpp item.h itemattributes.cpp \
	itemattributes.h items.cpp items.h luascript.cpp luascript.h \
	mailbox.cpp mailbox.h manager.cpp manager.h map.cpp map.h monster.cpp \
	monster.h monsters.cpp monsters.h movement.cpp movement.h \
	networkmessage.cpp networkmessage.h npc.cpp npc.h otpch.h otserv.cpp \
	otsystem.h outfit.cpp outfit.h outputmessage.cpp outputmessage.h \
	party.cpp party.h player.cpp player.h position.cpp position.h \
	protocol.cpp protocol.h protocolgame.cpp protocolgame.h \
	protocolhttp.cpp protocolhttp.h protocollogin.cpp protocollogin.h \
	protocolold.cpp protocolold.h quests.cpp quests.h raids.cpp raids.h \
	rsa.cpp rsa.h scheduler.cpp scheduler.h scriptmanager.cpp \
	scriptmanager.h server.cpp server.h spawn.cpp spawn.h spells.cpp \
	spells.h status.cpp status.h talkaction.cpp talkaction.h teleport.cpp \
	teleport.h templates.h textlogger.cpp textlogger.h thing.cpp thing.h \
	tile.cpp tile.h tools.cpp tools.h town.h trashholder.cpp trashholder.h \
	waitlist.cpp waitlist.h waypoints.h weapons.cpp weapons.h vocation.cpp \
	vocation.h
 
Back
Top