• 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 TFS 0.4_DEV Debian 9 compile

vena

New Member
Joined
Jun 21, 2017
Messages
63
Reaction score
2
Hi, i have a big problem with compile my source tfs 0.4_dev 3777
this->
Bash:
[email protected]:/home/otserv/source2# sh build.sh
TheForgottenServer build script -
Using ccache
CCache binaries located in /usr/lib/ccache

Start building on 1 cores, using 2 processes

make  all-am
make[1]: Entering directory '/home/otserv/source2'
  CXX      baseevents.o
  CXX      actions.o
In file included from baseevents.cpp:21:0:
tools.h:124:22: error: ‘int32_t round(float)’ conflicts with a previous declaration
 int32_t round(float v);
                      ^
In file included from /usr/include/boost/config/no_tr1/cmath.hpp:21:0,
                 from /usr/include/boost/functional/hash/detail/float_functions.hpp:14,
                 from /usr/include/boost/functional/hash/detail/hash_float.hpp:14,
                 from /usr/include/boost/functional/hash/hash.hpp:21,
                 from /usr/include/boost/functional/hash.hpp:6,
                 from /usr/include/boost/regex/v4/basic_regex.hpp:23,
                 from /usr/include/boost/regex/v4/regex.hpp:67,
                 from /usr/include/boost/regex.hpp:31,
                 from otpch.h:37,
                 from baseevents.cpp:17:
/usr/include/c++/6/cmath:1790:3: note: previous declaration ‘constexpr float std::round(float)                                                                                 ’
   round(float __x)
   ^~~~~
Makefile:556: recipe for target 'baseevents.o' failed
make[1]: *** [baseevents.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from actions.cpp:21:0:
tools.h:124:22: error: ‘int32_t round(float)’ conflicts with a previous declaration
 int32_t round(float v);
                      ^
In file included from /usr/include/boost/config/no_tr1/cmath.hpp:21:0,
                 from /usr/include/boost/functional/hash/detail/float_functions.hpp:14,
                 from /usr/include/boost/functional/hash/detail/hash_float.hpp:14,
                 from /usr/include/boost/functional/hash/hash.hpp:21,
                 from /usr/include/boost/functional/hash.hpp:6,
                 from /usr/include/boost/regex/v4/basic_regex.hpp:23,
                 from /usr/include/boost/regex/v4/regex.hpp:67,
                 from /usr/include/boost/regex.hpp:31,
                 from otpch.h:37,
                 from actions.cpp:17:
/usr/include/c++/6/cmath:1790:3: note: previous declaration ‘constexpr float std::round(float)                                                                                 ’
   round(float __x)
   ^~~~~
Makefile:556: recipe for target 'actions.o' failed
make[1]: *** [actions.o] Error 1
make[1]: Leaving directory '/home/otserv/source2'
Makefile:408: recipe for target 'all' failed
make: *** [all] Error 2
[email protected]:/home/otserv/source2#
 

sucibob

Member
Joined
Mar 28, 2017
Messages
128
Reaction score
13
download

edit
Makefile
Code:
SRC = actions.cpp admin.cpp allocator.cpp baseevents.cpp beds.cpp chat.cpp\
      combat.cpp condition.cpp configmanager.cpp connection.cpp container.cpp\
      creature.cpp creatureevent.cpp cylinder.cpp database.cpp\
      databasemanager.cpp databasemysql.cpp databasesqlite.cpp depot.cpp\
      dispatcher.cpp exception.cpp fileloader.cpp game.cpp gameservers.cpp\
      globalevent.cpp group.cpp house.cpp housetile.cpp ioban.cpp ioguild.cpp\
      iologindata.cpp iomap.cpp iomapserialize.cpp itemattributes.cpp item.cpp\
      items.cpp luascript.cpp mailbox.cpp manager.cpp map.cpp monster.cpp\
      monsters.cpp movement.cpp networkmessage.cpp npc.cpp otserv.cpp\
      outfit.cpp outputmessage.cpp party.cpp player.cpp position.cpp\
      protocol.cpp protocolgame.cpp protocolhttp.cpp protocollogin.cpp\
      protocolold.cpp quests.cpp raids.cpp rsa.cpp scheduler.cpp\
      scriptmanager.cpp server.cpp spawn.cpp spells.cpp status.cpp\
      talkaction.cpp teleport.cpp textlogger.cpp thing.cpp tile.cpp tools.cpp\
      trashholder.cpp vocation.cpp waitlist.cpp weapons.cpp

OBJ = ${SRC:.cpp=.o}

CC = g++
INCS = -I/usr/include/libxml2 -I/usr/include/lua5.1 -I.  
CPPFLAGS = -DHAVE_CONFIG_H -D__USE_MYSQL__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__ROOT_PERMISSION__ -D_THREAD_SAFE -D_REENTRANT
CXXFLAGS = -std=c++03 -Os -fomit-frame-pointer -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-array-bounds -pipe ${INCS} ${CPPFLAGS}
LDFLAGS = -s -llua5.1 -lmariadbclient -lcrypto -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lboost_thread -lz -lgmp -lxml2 -pthread
all: options tfs

options:
    @echo tfs build options:
    @echo "CXXFLAGS = ${CXXFLAGS}"
    @echo "LDFLAGS  = ${LDFLAGS}"
    @echo "CC       = ${CC}"

.cpp.o:
    @echo '${CC} $<'
    @${CC} -c ${CXXFLAGS} $<

tfs: ${OBJ}
    @echo CC -o [email protected]
    @${CC} -o [email protected] ${OBJ} ${LDFLAGS}

clean:
    @echo cleaning
    @rm -f tfs ${OBJ}

.PHONY: all clean options


run

cd 3777/src
make -j`nproc`
mv tfs ../../
 

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,368
Solutions
44
Reaction score
1,823
Location
Poland
GitHub
gesior
Function round is defined in tools.cpp and tools.h. You must remove it, as in new version of C++ that function is already defined as part of some standard C++ library.
 
Top