[SOLVED] Trying to compile my rust project in another computer


#1

I try to compile this project https://github.com/dancespiele/listing_people_api_actix in another computer but when I run cargo build it throw this error:

error: linking with `cc` failed: exit code: 1                                                                                                                                                                                                 
  |                                                                                                                                                                                                                                           
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.0.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.1.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.10.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.11.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.12.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.13.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.14.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.15.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.2.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.3.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.4.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.5.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.6.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.7.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.8.rcgu.o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.build_script_build.cp52zu6s-cgu.9.rcgu.o" "-o" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1" "/home/spielrs/projects/listing_people_api_actix/target/debug/build/failure_derive-0097f21b658259a1/build_script_build-0097f21b658259a1.2h2cd0kf1h50umq.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/spielrs/projects/listing_people_api_actix/target/debug/deps" "-L" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-a021829e87e39dcf.rlib" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-ce8b5a3ae3174a34.rlib" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-e0a5861af782ac1b.rlib" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-faa54f218b0e3149.rlib" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-60c1f13c2a2bc637.rlib" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-62fff61d9c213778.rlib" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-457f5d21aa274348.rlib" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-4694ab1fde4317be.rlib" "-Wl,--end-group" "/home/spielrs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-95d769f09dd6e7cb.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: collect2: error fatal: no se puede encontrar 'ld'                                                                                                                                                                                   
          compilación terminada.                                                                                                                                                                                                              
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              
error: aborting due to previous error                                                                                                                                                                                                         
                                                                                                                                                                                                                                              
error: Could not compile `failure_derive`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

I have installed gcc.


#2

My Spanish is limited but it seems you’re missing a linker — what happens if you do “which ld”?

If you’re on Linux, on most distros you can get a linker by installing the binutils package.


#3

Thanks a lot @strake it resolve that problem now I try to resolve this issue when I’m compiling

--- stderr
In file included from /usr/include/bits/posix1_lim.h:160,
                 from /usr/include/limits.h:183,
                 from /usr/lib64/gcc/x86_64-solus-linux/8.2.0/include-fixed/limits.h:194,
                 from /usr/lib64/gcc/x86_64-solus-linux/8.2.0/include-fixed/syslimits.h:7,
                 from /usr/lib64/gcc/x86_64-solus-linux/8.2.0/include-fixed/limits.h:34,
                 from crypto/fipsmodule/bn/exponentiation.c:110:
/usr/include/bits/local_lim.h:38:10: error fatal: linux/limits.h: No existe el fichero o el directorio
 #include <linux/limits.h>
          ^~~~~~~~~~~~~~~~

I tried to install clang-devel and musl-level but it doesn’t resolve my problem
It says, the library linux/limits.h doesn’t exist


#4

ok in solus I have to install develop component

sudo eopkg install -c system.devel

it resolve that issue.


#5

Now the last issue that I have compiling my project is:

/usr/bin/ld: cannot find -lpq


#6

You should probably install the postgresql-devel package.


#7

Do you have the PostgreSQL development package installed?


#8

thanks a lot @Riateche and @tjamaan, all you right, finally I had to install postgresql-devel