简体   繁体   中英

'ld' Error while compiling a module (Ubuntu 22.04)

I am trying to compile a module https://github.com/In-line/grip

I have installed the below tools

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
sudo apt-get install -y build-essential
sudo apt-get install -y libc6-dev libc6-dev-i386
sudo apt-get install -y cmake

I am getting the below error

root@test:/home/ubuntu/grip# make
/usr/bin/cmake -S/home/ubuntu/grip -B/home/ubuntu/grip --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/ubuntu/grip/CMakeFiles /home/ubuntu/grip//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/ubuntu/grip'
make  -f rust/CMakeFiles/grip-rust_target.dir/build.make rust/CMakeFiles/grip-rust_target.dir/depend
make[2]: Entering directory '/home/ubuntu/grip'
cd /home/ubuntu/grip && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/ubuntu/grip /home/ubuntu/grip/rust /home/ubuntu/grip /home/ubuntu/grip/rust /home/ubuntu/grip/rust/CMakeFiles/grip-rust_target.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/ubuntu/grip'
make  -f rust/CMakeFiles/grip-rust_target.dir/build.make rust/CMakeFiles/grip-rust_target.dir/build
make[2]: Entering directory '/home/ubuntu/grip'
make[2]: Nothing to be done for 'rust/CMakeFiles/grip-rust_target.dir/build'.
make[2]: Leaving directory '/home/ubuntu/grip'
[ 25%] Built target grip-rust_target
make  -f CMakeFiles/grip.dir/build.make CMakeFiles/grip.dir/depend
make[2]: Entering directory '/home/ubuntu/grip'
cd /home/ubuntu/grip && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/ubuntu/grip /home/ubuntu/grip /home/ubuntu/grip /home/ubuntu/grip /home/ubuntu/grip/CMakeFiles/grip.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/ubuntu/grip'
make  -f CMakeFiles/grip.dir/build.make CMakeFiles/grip.dir/build
make[2]: Entering directory '/home/ubuntu/grip'
[ 50%] Linking CXX shared library grip_amxx_i386.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/grip.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC  -Wall -Wextra -Wzero-as-null-pointer-constant -Wunknown-pragmas -m32 -O3 -mtune=generic -fvisibility=hidden -flto -fPIC -static-libgcc -static-libstdc++ -Wl,--gc-sections -Wl,--version-script=/home/ubuntu/grip/version_script.lds -fuse-ld=lld -shared -Wl,-soname,grip_amxx_i386.so -o grip_amxx_i386.so CMakeFiles/grip.dir/cpp/main.cpp.o CMakeFiles/grip.dir/third_party/amxmodx/public/sdk/amxxmodule.cpp.o  rust/i686-unknown-linux-gnu/debug/libgrip_rust.a -lpthread
collect2: fatal error: cannot find ‘ld’
compilation terminated.
make[2]: *** [CMakeFiles/grip.dir/build.make:117: grip_amxx_i386.so] Error 1
make[2]: Leaving directory '/home/ubuntu/grip'
make[1]: *** [CMakeFiles/Makefile2:103: CMakeFiles/grip.dir/all] Error 2
make[1]: Leaving directory '/home/ubuntu/grip'
make: *** [Makefile:94: all] Error 2
root@test:/home/ubuntu/grip#

which ld output

root@test:/home/ubuntu/grip# which ld
/usr/bin/ld

echo $PATH output

/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin

Can someone please help to solve this. I tried searching the web but couldn't get anything relevant.

One of my friend suggested to do

apt install lld

and the issue got resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM