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

[ubuntu 18.04] problem compiling at this distribution, this wasn't happening with win 10

Diarreamental

Well-Known Member
Joined
Jul 6, 2015
Messages
453
Solutions
1
Reaction score
80
Hello

im testing ubuntu 18.04 and im having troubles compiling otclient files at ubuntu 18.04, these were compilable at windows 10 without any problem.

i followed the github tutorial, also i did the step that we should do in cases we face certain issue in ubuntu.

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/.

but it hasn't fied anything , the same issue still persists

Code:
diarreamental@diarreamental-Lenovo-ideapad-300-14IBR:~/otclient$ cd build && cmake .. && make
-- Link to static libraries: ON
-- Build type: RelWithDebInfo
-- Build commit: devel
-- Build revision: 0
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
--   chrono
--   date_time
--   atomic
-- LuaJIT: OFF
-- Debug information: ON
-- Crash handler: ON
-- OpenGL ES: OFF
-- Bot protection: ON
-- Use precompiled header: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/diarreamental/otclient/build
[  1%] Linking CXX executable otclient
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libogg.a(framing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libogg.a(bitwise.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE 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:99: recipe for target 'CMakeFiles/otclient.dir/all' failed
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
 
Last edited:
Bash:
sudo make install
sudo mv /usr/local/lib/libphysfs.a /usr/lib/x86_64-linux-gnu/.

Why. Why would you do this? PhysFS is just a file abstraction layer anyway. You should use the one in the repos, there is no reason it needs to be bleeding edge. And if you insist, follow packaging standards. Sources. Packaging. Ubuntu-fied


/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libogg.a(framing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC

what happens when you trash build and do it over?

cd ~/otclient/build
rm -rfv ./*
cmake ../


If it still complains, maybe build libogg with PIE enabled? Did you do some hardening modifications to your OS? That's generally the only reason anyone uses PIE, and if so, you should probably rebuild your entire toolchain.
 
Bash:
sudo make install
sudo mv /usr/local/lib/libphysfs.a /usr/lib/x86_64-linux-gnu/.

Why. Why would you do this? PhysFS is just a file abstraction layer anyway. You should use the one in the repos, there is no reason it needs to be bleeding edge. And if you insist, follow packaging standards. Sources. Packaging. Ubuntu-fied




what happens when you trash build and do it over?

cd ~/otclient/build
rm -rfv ./*
cmake ../


If it still complains, maybe build libogg with PIE enabled? Did you do some hardening modifications to your OS? That's generally the only reason anyone uses PIE, and if so, you should probably rebuild your entire toolchain.
dunno i just followed the ithub tutorial, im using cleant otclient

im gonna test im recompiling atm
is still crashing @Lessaire
Code:
[ 88%] Building CXX object CMakeFiles/otclient.dir/src/client/uisprite.cpp.o
[ 89%] Building CXX object CMakeFiles/otclient.dir/src/main.cpp.o
[ 90%] Linking CXX executable otclient
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libogg.a(framing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libogg.a(bitwise.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE 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:99: recipe for target 'CMakeFiles/otclient.dir/all' failed
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
felipe@Felipe-Lenovo-ideapad-300-14IBR:~/otclient/build$
 
Last edited:
why is this makefile trying to use libogg.a?

What is the origin of these OTClient files?
edubart otclient
i followed linux tutoial for ubunutu
 
try this:
Bash:
cd ~/otclient/build
rm -rfv ./*
cmake \
    -DLUAJIT:BOOL=ON \
    -DOpenGL_GL_PREFERENCE:STRING="GLVND" \
    -DCMAKE_BUILD_TYPE:STRING=Release   \
    -DUSE_STATIC_LIBS:BOOL=OFF \
    -DCMAKE_CXX_FLAGS:STRING=-march=native \
    -DCMAKE_BUILD_TYPE:STRING=Release \
    ../ ; #
 
@Lessaire
did not works either
Code:
diarreamental@diarreamental-Lenovo-ideapad-300-14IBR:~$ cd ~/otclient/build
diarreamental@diarreamental-Lenovo-ideapad-300-14IBR:~/otclient/build$ sudo -i
[sudo] password for diarreamental:
root@diarreamental-Lenovo-ideapad-300-14IBR:~# rm -rfv ./*
root@diarreamental-Lenovo-ideapad-300-14IBR:~# cmake \
> -DLUAJIT:BOOL=ON \
>     -DOpenGL_GL_PREFERENCE:STRING="GLVND" \
>     -DCMAKE_BUILD_TYPE:STRING=Release   \
>     -DUSE_STATIC_LIBS:BOOL=OFF \
>     -DCMAKE_CXX_FLAGS:STRING=-march=native \
>     -DCMAKE_BUILD_TYPE:STRING=Release \
>     ../ ; #
CMake Error: The source directory "/" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
root@diarreamental-Lenovo-ideapad-300-14IBR:~# rm -trf./*
rm: invalid option -- 't'
Try 'rm --help' for more information.
root@diarreamental-Lenovo-ideapad-300-14IBR:~#  -DLUAJIT:BOOL=ON
-DLUAJIT:BOOL=ON: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~#     -DOpenGL_GL_PREFERENCE:STRING="GLVND"
-DOpenGL_GL_PREFERENCE:STRING=GLVND: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~#     -DCMAKE_BUILD_TYPE:STRING=Release   -DCMAKE_BUILD_TYPE:STRING=Release: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~#     -DUSE_STATIC_LIBS:BOOL=OFF
-DUSE_STATIC_LIBS:BOOL=OFF: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~#     -DCMAKE_CXX_FLAGS:STRING=-march=native
-DCMAKE_CXX_FLAGS:STRING=-march=native: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~#     -DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_BUILD_TYPE:STRING=Release: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~#     ../ ; #
-bash: ../: Is a directory
root@diarreamental-Lenovo-ideapad-300-14IBR:~#    -DLUAJIT:BOOL=ON \
>     -DOpenGL_GL_PREFERENCE:STRING="GLVND" \
>     -DCMAKE_BUILD_TYPE:STRING=Release   \
>     -DUSE_STATIC_LIBS:BOOL=OFF \
>     -DCMAKE_CXX_FLAGS:STRING=-march=native \
>     -DCMAKE_BUILD_TYPE:STRING=Release \
>     ../ ; #
-DLUAJIT:BOOL=ON: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~# ^C
root@diarreamental-Lenovo-ideapad-300-14IBR:~# -DLUAJIT:BOOL=ON
-DLUAJIT:BOOL=ON: command not found
root@diarreamental-Lenovo-ideapad-300-14IBR:~#
 
Bro.. that's because your shell padded the line end after \ with extra characters. You can very clearly see in the output that was given it was trying to run the parameters we wanted to give to cmake as if they were separate whole commands, which they clearly are not.

Paste it as one line, link any sane shell should have done for you automatically:

Bash:
cmake -Wno-dev -DLUAJIT:BOOL=ON -DOpenGL_GL_PREFERENCE:STRING="GLVND" -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_STATIC_LIBS:BOOL=OFF -DCMAKE_CXX_FLAGS:STRING=-march=native -DCMAKE_BUILD_TYPE:STRING=Release ../ ; #


Here, I even made a vid to demonstrate the failure that is whatever Terminal Emulator you are using.
 
Last edited:
Bro.. that's because your shell padded the line end after \ with extra characters. You can very clearly see in the output that was given it was trying to run the parameters we wanted to give to cmake as if they were separate whole commands, which they clearly are not.

Paste it as one line, link any sane shell should have done for you automatically:

Bash:
cmake -Wno-dev -DLUAJIT:BOOL=ON -DOpenGL_GL_PREFERENCE:STRING="GLVND" -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_STATIC_LIBS:BOOL=OFF -DCMAKE_CXX_FLAGS:STRING=-march=native -DCMAKE_BUILD_TYPE:STRING=Release ../ ; #


Here, I even made a vid to demonstrate the failure that is whatever Terminal Emulator you are using.
im ot using terminal emilator im using ubuntu 18.04, could you help me via remote?
pls?
 
try this:
Bash:
cd ~/otclient/build
rm -rfv ./*
cmake \
    -DLUAJIT:BOOL=ON \
    -DOpenGL_GL_PREFERENCE:STRING="GLVND" \
    -DCMAKE_BUILD_TYPE:STRING=Release   \
    -DUSE_STATIC_LIBS:BOOL=OFF \
    -DCMAKE_CXX_FLAGS:STRING=-march=native \
    -DCMAKE_BUILD_TYPE:STRING=Release \
    ../ ; #
THIS DELETED EVERYTHING INSIDE FOLDER XD
 
Yes, it's SUPPOSED TO ->
cd ~/otclient/build
rm -rfv ./*

It's supposed to wipe the BUILD.
The build is irrelevant. You can make it again! You wipe the build everytime you alter your CMakeLists in the root or the source tree!

If your build or your otclient folder were some place else, and you just blindly ran these commands without adapting them to your situation, and the first one error cuz the folder didn't exist, and you still ran the second? You lay that at your own feet, not mine. :mad:
 
Thats an easy fix. I don't know why nobody has the answer right the way for that since all linux users will face to the same problem

At your CMakeLists.txt

Change:
Code:
if(NOT APPLE)
    set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-Map=${PROJECT_NAME}.map")
endif()
to:
Code:
if(NOT APPLE)
    set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -no-pie -Wl,-Map=${PROJECT_NAME}.map")
endif()

Then start all over again (clear build folder, cmake ..make.. etc..)
 
Thats an easy fix. I don't know why nobody has the answer right the way for that since all linux users will face to the same problem

Yeah, we covered that for this guy in another thread already. Then see this here, that's when I spent several hours helping him over remote and had both tfs and otclient building for him.
 
bash: cd: otclient: No such file or directory
rata@la-rata:~/otclient/build$ mkdir -p build && cd build && cmake ..
-- Link to static libraries: ON
-- Build type: RelWithDebInfo
-- Build commit: devel
-- Build revision: 0
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- system
-- thread
-- filesystem
-- chrono
-- date_time
-- atomic
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Lua (missing: LUA_LIBRARY LUA_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
src/framework/cmake/FindLua.cmake:17 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/framework/CMakeLists.txt:217 (find_package)
CMakeLists.txt:12 (include)


-- Configuring incomplete, errors occurred!
See also "/home/rata/otclient/build/CMakeFiles/CMakeOutput.log".
See also "/home/rata/otclient/build/CMakeFiles/CMakeError.log".
rata@la-rata:~/otclient/build/build$
 
yeah? can you not read it?
Could NOT find Lua (missing: LUA_LIBRARY LUA_INCLUDE_DIR)

Did you even try to figure this out on your own? 😠
I left you with a working installation of packages and the right cmake command to find it and build?
It took a significant amount of time. What happened to it?
 
CAN'T FND NOR LUA NOR UAJIT BOTH ISNTALLED :s
Lua:
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find LuaJIT (missing: LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  src/framework/cmake/FindLuaJIT.cmake:16 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/framework/CMakeLists.txt:209 (find_package)
  CMakeLists.txt:12 (include)


-- Configuring incomplete, errors occurred!
See also "/home/rata/otclient/build/CMakeFiles/CMakeOutput.log".
See also "/home/rata/otclient/build/CMakeFiles/CMakeError.log".
rata@la-rata:~/otclient/build$
 

Similar threads

Back
Top