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

TFS 0.X Compile 0.4 on debian 11

hiwyn

Member
Joined
Aug 30, 2021
Messages
78
Reaction score
8
I used to follow this steps to compile 0.4 (GitHub - Fir3element/3777 (https://github.com/Fir3element/3777)) on debian 9:
Code:
apt-get install autoconf build-essential pkg-config automake libboost-all-dev libgmp3-dev libxml2-dev liblua5.1-0-dev libssl-dev libsqlite3-dev
apt-get install libmariadbclient-dev
make -j`nproc`

but now on debian 11 there is no apt-get install libmariadbclient-dev
sudo apt-get install libmariadbclient-dev
Code:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libmariadbclient-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libmariadb-dev-compat:i386 libmariadb-dev:i386 libmariadb-dev-compat libmariadb-dev

E: Package 'libmariadbclient-dev' has no installation candidate

so i tried sudo apt-get install libmariadb-dev, idk why, just looks the same
Code:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libmariadb3 mariadb-common mysql-common
The following NEW packages will be installed:
  libmariadb-dev libmariadb3 mariadb-common mysql-common
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 402 kB of archives.
After this operation, 1,451 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bullseye/main amd64 mysql-common all 5.8+1.0.7 [7,464 B]
Get:2 http://deb.debian.org/debian bullseye/main amd64 mariadb-common all 1:10.5.11-1 [36.3 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 libmariadb3 amd64 1:10.5.11-1 [175 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libmariadb-dev amd64 1:10.5.11-1 [184 kB]
Fetched 402 kB in 0s (2,613 kB/s)       
Selecting previously unselected package mysql-common.
(Reading database ... 214412 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.7_all.deb ...
Unpacking mysql-common (5.8+1.0.7) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../mariadb-common_1%3a10.5.11-1_all.deb ...
Unpacking mariadb-common (1:10.5.11-1) ...
Selecting previously unselected package libmariadb3:amd64.
Preparing to unpack .../libmariadb3_1%3a10.5.11-1_amd64.deb ...
Unpacking libmariadb3:amd64 (1:10.5.11-1) ...
Selecting previously unselected package libmariadb-dev.
Preparing to unpack .../libmariadb-dev_1%3a10.5.11-1_amd64.deb ...
Unpacking libmariadb-dev (1:10.5.11-1) ...
Setting up mysql-common (5.8+1.0.7) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mariadb-common (1:10.5.11-1) ...
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up libmariadb3:amd64 (1:10.5.11-1) ...
Setting up libmariadb-dev (1:10.5.11-1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13) ...

but when i try to make -j`nproc` its stops on this error
Code:
make -j`nproc`
tfs build options:
CXXFLAGS = -std=c++03 -Os -fomit-frame-pointer -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-array-bounds -pipe -I/usr/include/libxml2 -I/usr/include/lua5.1 -I.   -DHAVE_CONFIG_H -D__USE_MYSQL__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__ROOT_PERMISSION__ -D_THREAD_SAFE -D_REENTRANT
g++ player.cpp
LDFLAGS  = -s -llua5.1 -lmariadbclient -lcrypto -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lboost_thread -lz -lgmp -lxml2 -pthread
CC       = g++
In file included from database.h:301,
                 from luascript.h:39,
                 from baseevents.h:22,
                 from raids.h:26,
                 from item.h:29,
                 from tile.h:23,
                 from map.h:26,
                 from creature.h:28,
                 from player.h:23,
                 from player.cpp:20:
databasemysql.h:28:10: fatal error: mysql/mysql.h: No such file or directory
   28 | #include <mysql/mysql.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:34: player.o] Error 1

this is my Makefile (i get here on forum in a tutorial explain how to compile otc for debian9)
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 $@
    @${CC} -o $@ ${OBJ} ${LDFLAGS}

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

.PHONY: all clean options

what should i do to compile it?
i had to leave debian 9 but still want to create my ot project...
 
 
Solution

i manage to compile it thanks to the @Gesior.pl
 
Back
Top