Closed gknn053 closed 7 months ago
Clone the repo again with its submodules (--recursive or --recurse-submodules) then try building.
[ 36%] Built target xashmenu [ 37%] Linking C executable xash3d /usr/bin/ld: /usr/local/lib/libSDL2.so: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status make[2]: [game_launch/CMakeFiles/xash3d.dir/build.make:99: game_launch/xash3d] Error 1 make[1]: [CMakeFiles/Makefile2:160: game_launch/CMakeFiles/xash3d.dir/all] Error 2 make: *** [Makefile:156: all] Error 2
now I get this error.
Please check that you are building the the same architecture as your dependencies, perhaps your libSDL is 64bit while project is trying to build 32bit
I just don't understand how to fix libSDL2.
What's your distro and what cpu do you have?
Ubuntu 20.04.6 LTS
You have to install 32bit version of SDL2.
sudo dpkg --add-architecture i386
sudo apt-get install libsdl2-dev:i386
Clean your build files and try again with this.
Seeing that you are SSHed in some remote system don't you wanna build dedicated server instead of client? You didn't provide any further info on what you are trying to build.
You have to install 32bit version of SDL2.
sudo dpkg --add-architecture i386 sudo apt-get install libsdl2-dev:i386
Clean your build files and try again with this.
I deleted and reinstalled all packages, same result.
Seeing that you are SSHed in some remote system don't you wanna build dedicated server instead of client? You didn't provide any further info on what you are trying to build.
I just want to open a solid server.
So dedicated. I recommend to build 32-bit binary so it works with AMXX and exiting mods
sudo apt install gcc-multilib g++-multilib
redownload xash3d repo
cmake . -DXASH_DEDICATED=yes -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_EXE_LINKER_FLAGS="-m32"
Tested this on Ubuntu 22.04.1
I was able to reinstall Ubuntu and fix the problem, thanks for help
-- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Target architecture: i386 -- Building for 64 Bit CMake Error at cmake/FWGSLib.cmake:84 (add_subdirectory): The source directory
does not contain a CMakeLists.txt file. Call Stack (most recent call first): CMakeLists.txt:132 (fwgs_conditional_subproject)
CMake Deprecation Warning at game_launch/CMakeLists.txt:23 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
--
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found SDL2: /usr/local/lib/libSDL2main.a;/usr/local/lib/libSDL2.so;-lpthread
-- </FindSDL2.cmake> /usr/local/lib/libSDL2main.a;/usr/local/lib/libSDL2.so;-lpthread
CMake Deprecation Warning at engine/CMakeLists.txt:22 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
-- looking for liblzma -- Could not find libunwind (missing: LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES) -- libunwind not found --
-- </FindSDL2.cmake> /usr/local/lib/libSDL2main.a;/usr/local/lib/libSDL2.so;-lpthread
-- git hash: 3589a50e
-- Disabled PIE for xash
-- Configuring incomplete, errors occurred!
I have installed all the necessary packages, the build gives an error. What am I doing wrong?