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

OTClient Error compile new OTC debian

gmstrikker

Active Member
Joined
Jul 30, 2014
Messages
457
Solutions
1
Reaction score
49
Guys i have an very old otclient version (like 3 years ago), so today i tried to download a new one

But when i try to compile i got these errors:
Code:
[ 12%] Building CXX object CMakeFiles/otclient.dir/src/framework/core/filestream.cpp.o
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘void FileStream::cache()’:
/home/usr/otclient/src/framework/core/filestream.cpp:71:62: error: ‘PHYSFS_readBytes’ was not declared in this scope
         if(PHYSFS_readBytes(m_fileHandle, m_data.data(), size) == -1)
                                                              ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘void FileStream::flush()’:
/home/usr/otclient/src/framework/core/filestream.cpp:100:66: error: ‘PHYSFS_writeBytes’ was not declared in this scope
             if(PHYSFS_writeBytes(m_fileHandle, m_data.data(), len) != len)
                                                                  ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘int FileStream::read(void*, uint32, uint32)’:
/home/usr/otclient/src/framework/core/filestream.cpp:112:70: error: ‘PHYSFS_readBytes’ was not declared in this scope
         int res = PHYSFS_readBytes(m_fileHandle, buffer, size * nmemb);
                                                                      ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘void FileStream::write(const void*, uint32)’:
/home/usr/otclient/src/framework/core/filestream.cpp:133:57: error: ‘PHYSFS_writeBytes’ was not declared in this scope
         if(PHYSFS_writeBytes(m_fileHandle, buffer, count) != count)
                                                         ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘uint8 FileStream::getU8()’:
/home/usr/otclient/src/framework/core/filestream.cpp:187:48: error: ‘PHYSFS_readBytes’ was not declared in this scope
         if(PHYSFS_readBytes(m_fileHandle, &v, 1) != 1)
                                                ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘int8 FileStream::get8()’:
/home/usr/otclient/src/framework/core/filestream.cpp:250:48: error: ‘PHYSFS_readBytes’ was not declared in this scope
         if(PHYSFS_readBytes(m_fileHandle, &v, 1) != 1)
                                                ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘std::__cxx11::string FileStream::getString()’:
/home/usr/otclient/src/framework/core/filestream.cpp:316:58: error: ‘PHYSFS_readBytes’ was not declared in this scope
             if(PHYSFS_readBytes(m_fileHandle, buffer, len) == 0)
                                                          ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘void FileStream::addU8(uint8)’:
/home/usr/otclient/src/framework/core/filestream.cpp:357:49: error: ‘PHYSFS_writeBytes’ was not declared in this scope
         if(PHYSFS_writeBytes(m_fileHandle, &v, 1) != 1)
                                                 ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘void FileStream::add8(int8)’:
/home/usr/otclient/src/framework/core/filestream.cpp:404:49: error: ‘PHYSFS_writeBytes’ was not declared in this scope
         if(PHYSFS_writeBytes(m_fileHandle, &v, 1) != 1)
                                                 ^
/home/usr/otclient/src/framework/core/filestream.cpp: In member function ‘void FileStream::throwError(const string&, bool)’:
/home/usr/otclient/src/framework/core/filestream.cpp:458:94: error: ‘PHYSFS_getLastErrorCode’ was not declared in this scope
         completeMessage += std::string(": ") + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode());
                                                                                              ^
/home/usr/otclient/src/framework/core/filestream.cpp:458:95: error: ‘PHYSFS_getErrorByCode’ was not declared in this scope
         completeMessage += std::string(": ") + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode());
                                                                                               ^
CMakeFiles/otclient.dir/build.make:470: recipe for target 'CMakeFiles/otclient.dir/src/framework/core/filestream.cpp.o' failed
make[2]: *** [CMakeFiles/otclient.dir/src/framework/core/filestream.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/otclient.dir/all' failed
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2


what i done to compile?
this steps i found on forum:

deps
Code:
apt-get install build-essential cmake git-core liblua5.1-0-dev libvorbis-dev libopenal-dev libphysfs-dev libz3-dev freeglut3-dev libc6-dev-i386 doxygen libncurses5-dev mercurial libboost-all-dev libglew-dev
apt-get install libc++-dev libssl-dev
apt-get install libssl1.0-dev // i think that is who works

wget https://icculus.org/physfs/downloads/physfs-2.0.3.tar.bz2
tar -xjf physfs-2.0.3.tar.bz2
cd physfs-2.0.3/ && mkdir build && cd build && cmake .. && make
make install
cp /usr/local/lib/libphysfs.so.2.0.3 /usr/lib/x86_64-linux-gnu/

mkdir -p /usr/local/ssl/lib /usr/local/ssl/include
wget http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl-dev_1.0.1t-1+deb8u6_amd64.deb
ar -x libssl-dev_1.0.1t-1+deb8u6_amd64.deb
tar xf data.tar.xz

cp usr/lib/x86_64-linux-gnu/libcrypto.so /usr/local/ssl/lib (ERROR)
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0* /usr/local/ssl/lib

build
Code:
git clone https://github.com/mehah/otclient

mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Debug -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_CRYPTO_LIBRARY=/usr/local/ssl/lib/libcrypto.so.1.0.2 -DOPENSSL_LIBRARY=/usr/local/ssl/lib/libssl.so.1.0.2 -DOPENSSL_INCLUDE_DIR=/usr/local/ssl/include -DUSE_STATIC_LIBS=OFF ..

the old version from 3 years ago compile by doing those steps, but this new mehah's don't...
why? what should i do?
 
Solution
I think u are rigth, ty
Now it stops on 100%, saying that i need to recompile with -fPIC, how to do it?

Code:
[ 99%] Building CXX object CMakeFiles/otclient.dir/src/main.cpp.o
[100%] Linking CXX executable otclient
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libogg.a(framing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libogg.a(bitwise.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status...

nugo

Australia OT Mapper
Joined
Apr 1, 2009
Messages
375
Solutions
4
Reaction score
177
i compiled mehans on windows few weeks ago



Create folder in C drive - Call it What ever - You need MSV2019 (not 2017)
1. Open Git Bash here in the created folder and paste "git clone microsoft/vcpkg (https://github.com/Microsoft/vcpkg)"
2. Open directory vcpkg in file explorer
3. In directory vcpkg open power shell (type power shell in adress bar)
4. paste .\bootstrap-vcpkg.bat - wait for install to finish
5. paste .\vcpkg integrate install - wait for install to finish (anti virus prob go ape shit)
6. open directory vcpkg if not already inand git bash here "git clone --recursive mehah/otclient (https://github.com/mehah/otclient.git)" (this will create otlcient directory with sources)
7. in the same directory vcpkg open power shell and paste this command (for 64 bit client) " .\vcpkg install boost-iostreams:x64-windows boost-asio:x64-windows boost-system:x64-windows boost-variant:x64-windows boost-lockfree:x64-windows luajit:x64-windows glew:x64-windows boost-filesystem:x64-windows boost-uuid:x64-windows physfs:x64-windows openal-soft:x64-windows libogg:x64-windows libvorbis:x64-windows zlib:x64-windows opengl:x64-windows"
8. Step 7 takes a while go watch netflix or something Gyazo (https://gyazo.com/3baf4b0e75d4673cdcbf7dc4294c01b7)
9. Open vc14/otclient.vcxproj. This should launch Visual Studio.
10. Choose build configuration from the drop downs Release and x64. For best performance choose Release & x64.
11. Menu > Build > Build
12. Cry tears of joys its now all over
 
OP
gmstrikker

gmstrikker

Active Member
Joined
Jul 30, 2014
Messages
457
Solutions
1
Reaction score
49
i used to follow:
in a old otclient version and works (same debian)

what happen now?
 
OP
gmstrikker

gmstrikker

Active Member
Joined
Jul 30, 2014
Messages
457
Solutions
1
Reaction score
49
I've tried:
Code:
sudo apt-get install libncurses5-dev
sudo apt-get install mercurial
hg clone -r stable-3.0 http://hg.icculus.org/icculus/physfs/
cd physfs
sudo mkdir build
cd build
sudo cmake ..
sudo make
sudo make install
sudo mv /usr/local/lib/libphysfs.a /usr/lib/x86_64-linux-gnu/.

And then compile again...
But got this error:
Code:
[ 88%] Building CXX object CMakeFiles/otclient.dir/src/main.cpp.o
make[2]: *** No rule to make target '/usr/local/lib/libphysfs.a', needed by 'otclient'.  Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/otclient.dir/all' failed
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Why?
 

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
I've tried:
Code:
sudo apt-get install libncurses5-dev
sudo apt-get install mercurial
hg clone -r stable-3.0 http://hg.icculus.org/icculus/physfs/
cd physfs
sudo mkdir build
cd build
sudo cmake ..
sudo make
sudo make install
sudo mv /usr/local/lib/libphysfs.a /usr/lib/x86_64-linux-gnu/.

And then compile again...
But got this error:
Code:
[ 88%] Building CXX object CMakeFiles/otclient.dir/src/main.cpp.o
make[2]: *** No rule to make target '/usr/local/lib/libphysfs.a', needed by 'otclient'.  Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/otclient.dir/all' failed
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Why?
Did you remove OTC 'build' dir, create it again and run 'cmake ..' again? It may be required to make it notice new library in system.

You moved installed PhysFS file from /usr/local/lib/libphysfs.a to /usr/lib/x86_64-linux-gnu/ and error reports problem with /usr/local/lib/libphysfs.a , so it detected old system physfs file or it did not even try to detect new file as you did not recreate 'build' dir.
 
Last edited:
OP
gmstrikker

gmstrikker

Active Member
Joined
Jul 30, 2014
Messages
457
Solutions
1
Reaction score
49
Did you remove OTC 'build' dir, create it again and run 'cmake ..' again? It may be required to make it notice new library in system.

You moved installed PhysFS file from /usr/local/lib/libphysfs.a to /usr/lib/x86_64-linux-gnu/ and error reports problem with /usr/local/lib/libphysfs.a , so it detected old system physfs file or it did not even try to detect new file as you did not recreate 'build' dir from scratch.

I think u are rigth, ty
Now it stops on 100%, saying that i need to recompile with -fPIC, how to do it?

Code:
[ 99%] Building CXX object CMakeFiles/otclient.dir/src/main.cpp.o
[100%] Linking CXX executable otclient
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libogg.a(framing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libogg.a(bitwise.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeFiles/otclient.dir/build.make:3857: recipe for target 'otclient' failed
make[2]: *** [otclient] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/otclient.dir/all' failed
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
 

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
I think u are rigth, ty
Now it stops on 100%, saying that i need to recompile with -fPIC, how to do it?

Code:
[ 99%] Building CXX object CMakeFiles/otclient.dir/src/main.cpp.o
[100%] Linking CXX executable otclient
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libogg.a(framing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libogg.a(bitwise.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeFiles/otclient.dir/build.make:3857: recipe for target 'otclient' failed
make[2]: *** [otclient] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/otclient.dir/all' failed
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Edit file CMakesList.txt
Find:
Code:
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-Map=${PROJECT_NAME}.map")
Replace with:
Code:
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -fPIC -no-pie -Wl,-Map=${PROJECT_NAME}.map")
and again... remove 'build'.
 
Solution
OP
gmstrikker

gmstrikker

Active Member
Joined
Jul 30, 2014
Messages
457
Solutions
1
Reaction score
49
Top