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

C++ ERROR!! Need geek c++

Svira

Active Member
Joined
Jan 27, 2008
Messages
263
Solutions
11
Reaction score
35
Hello,
for several days trying to compile the engine, I've solved millions of errors with libraries or MarinaDB/SqLite4

My console error:
Code:
iologindata.cpp: In member function 'std::__cxx11::string IOLoginData::getCheckPlayerLevel(const string&) const':
iologindata.cpp:1649:8: error: could not convert 'false' from 'bool' to 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
 return false;
        ^~~~~
mv -f .deps/networkmessage.Tpo .deps/networkmessage.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2   -O2 -fomit-frame-pointer  -D__USE_SQLITE__  -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-array-bounds -pthread -pipe -MT npc.o -MD -MP -MF .deps/npc.Tpo -c -o npc.o npc.cpp
Makefile:547: recipe for target 'iologindata.o' failed
make[1]: *** [iologindata.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/movement.Tpo .deps/movement.Po
mv -f .deps/monster.Tpo .deps/monster.Po
mv -f .deps/monsters.Tpo .deps/monsters.Po
mv -f .deps/npc.Tpo .deps/npc.Po
make[1]: Leaving directory '/home/ots/build/src'
Makefile:404: recipe for target 'all' failed
make: *** [all] Error 2

HELP ME!
Code:
Project Name
        The Forgotten Server

    Version
        0.4.0_DEV
[ COMPILING
    GNU\Linux - Debian (...and forks, eg. Ubuntu)
        A detailed and always up-to-date tutorial may be found here:
            http://otland.net/f137/linux-ultimate-compile-guide-debian-ubuntu-included-2868/

        Root
            You need to get on root user or use sudo for almost all below operations.

        Download required packages
            Launch a terminal, and paste in the following commands:
                apt-get install libboost1.38-dev liblua5.1-0 liblua5.1-0-dev liblua50 liblua50-dev liblualib50 liblualib50-dev lua50 libsqlite0 libsqlite0-dev libsqlite3-0 libsqlite3-dev sqlite3 lua5.1 libmysql++-dev libgmp3-dev subversion make g++ libxml2 libxml2-dev libxml++2.6-dev libmysqlclient15-dev mysql-client-5.0 mysql-common mysql-server-5.0 gcc cpp automake autoconf pkg-config zlib1g-dev ccache libcrypto++-dev

        Download sources
            Launch a terminal, and paste in this command:
                svn co http://svn.otland.net/public/forgottenserver/tags/0.4.0_DEV

        Compiling
            Launch a terminal, and type this:
                cd 0.4.0_DEV && ./autogen.sh && ./configure --enable-sqlite --enable-server-diag && ./build.sh

        Linker error
            If you receive a linker error saying something with 'libboost', try pasting the following commands to terminal and then move back to compiling again:
                wget http://garr.dl.sourceforge.net/sourceforge/asio/boost_asio_1_0_0.tar.gz
                tar -xzf boost_asio_1_0_0.tar.gz
                cp -ar boost_asio_1_0_0/boost/* /usr/include/boost/
                g++ boost_asio_1_0_0/libs/system/src/error_code.cpp -c -o /usr/lib/libboost_system.a
                ln /usr/lib/libboost_regex-mt.so /usr/lib/libboost_regex.so
                ln /usr/lib/libboost_regex-mt.a /usr/lib/libboost_regex.a
                ln /usr/lib/libboost_thread-mt.so /usr/lib/libboost_thread.so
                ln /usr/lib/libboost_thread-mt.a /usr/lib/libboost_thread.a
                rm -rf boost_asio_1_0_0 boost_asio_1_0_0.tar.gz
 
iologindata.cpp:1649:8: error: could not convert 'false' from 'bool' to 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
return false;
^~~~~

Include the function this occurs in, we're not magicians. I'm assuming the function returns an std::string but you're using return false and there's no implicit conversion matching those types.
 
change return false; too return 0;

now is:

Code:
protocolgame.cpp:2963:158: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if(speaker && type != SPEAK_RVR_ANSWER && !speaker->isAccountManager() && !speaker->hasCustomFlag(PlayerCustomFlag_HideLevel) && (pg == NULL || pg != NULL && !pg->getIsCast()))
                                                                                                                                                   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Makefile:547: recipe for target 'protocolgame.o' failed
make[1]: *** [protocolgame.o] Error 1
make[1]: Leaving directory '/home/ots/build/src'
Makefile:404: recipe for target 'all' failed
make: *** [all] Error 2
 
Why are you completely disregarding what I asked for? What was the point of even asking for a response? Throwing new values willy-nilly can cause other problems as well if you have no clue what return values to use for the function that's giving you errors. And for the 2nd error (actually a warning) do what it tells you to. Put parentheses around that condition (it literally underlines what you need to put in parentheses for you).
 
I did not ignore it, in the meantime I found such a solution in another forum. I am backing up and working with your instructions, editing the post as I will get the result.

edit

Code:
root@svira:/home/ots/svira# ./theforgottenserver
./theforgottenserver: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

i try to fix by:
Code:
chmod: cannot access '/usr/lib64/libmysqlclient.so.16': No such file or director                                                                                                                                                             y
root@svira:/home/ots/svira# apt install libmysqlclient-devinstall libmysqlclient                                                                                                                                                             -dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libmysqlclient-dev is not available, but is referred to by another packa                                                                                                                                                             ge.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package libmysqlclient-devinstall
E: Package 'libmysqlclient-dev' has no installation candidate
root@svira:/home/ots/svira# apt search libmysqlclient-dev
Sorting... Done
Full Text Search... Done
default-libmysqlclient-dev/oldstable,now 1.0.2 amd64 [installed]
  MySQL database development files (metapackage)

libglpk40/oldstable,now 4.61-1 amd64 [installed]
  linear programming kit with integer (MIP) support

root@svira:/home/ots/svira#

and still have error:
Code:
./theforgottenserver: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
whwere i can found it?
 
Last edited:
Ok, i found solution but have new error...
Code:
./theforgottenserver: error while loading shared libraries: libcrypto++.so.8: cannot open shared object file: No such file or directory
 
Hello Svira,

You haven't linked the library correctly, there are a few ways to solve this, either reinstall it and hope it gets linked by the system or you have to locate it (usually inside /usr/local/lib, /usr/local/lib64, /usr/lib and /usr/lib64) and either path it or enter the path on your forgottenservers Makefile.

If you plan to do further source edits, please take your time and learn the system you're working with. Delusion stated we are not magicians (maybe he is one, but that's for another talk), most of your questions regarding the compiler itself are solved for a long time and can be found on stack overflow.

Best Wishes,
Okke
 
it's all bad by MarinaDB, there are no old libraries anymore ... How do you change it in the sources?
 

Attachments

Back
Top