linking with `x86_64-linux-musl-gcc` failed: exit status: 1 - rust

I am trying to cross compile the rust app in macOS Monterey 12.3.1 with M1 chip so that I could run the rust app in alpine linux in docker container. When I am using this command to compile the app:
CROSS_COMPILE=x86_64-linux-musl- RUSTFLAGS="-C target-feature=-crt-static" cargo build --release --target x86_64-unknown-linux-musl
shows error:
error: linking with `x86_64-linux-musl-gcc` failed: exit status: 1
|
= note: "x86_64-linux-musl-gcc" "-m64" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.0.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.1.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.10.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.11.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.12.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.13.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.14.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.15.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.2.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.3.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.4.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.5.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.6.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.7.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.8.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.fortune.63b2375e-cgu.9.rcgu.o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c.als9akela8bt3uk.rcgu.o" "-Wl,--as-needed" "-L" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps" "-L" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/release/deps" "-L" "/opt/homebrew/opt/libpq/lib" "-L" "/opt/homebrew/opt/openssl#3/lib" "-L" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/build/ring-a5403edcb6d58bf6/out" "-L" "/Users/xiaoqiangjiang/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/librust_wheel-00902c352b3f2452.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libconfig-cdf1121056f01fa9.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libini-baccd911e21f2baa.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libserde_hjson-a3ca5b393bc18c12.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libserde-a149be284464586e.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libnum_traits-8cd7e27971195be4.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libyaml_rust-870c039f63a1ef10.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/liblinked_hash_map-f193d192da399cc3.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libnom-e894b0573ee83340.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/liblexical_core-adb69b5349c5c039.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libstatic_assertions-04860f757594c1c3.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libarrayvec-27476d4e5591a510.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libreqwest-fe50b8c292cbf8a6.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libhyper_tls-1310c474f28288da.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libserde_urlencoded-d29f8ef7319ae572.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libipnet-26095768283b3d24.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libtokio_native_tls-6f1612fc5430c496.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libnative_tls-68344b11299211ad.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libopenssl_probe-694309879794c201.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libopenssl-4907fb7e39035744.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libforeign_types-d0e56b9eca01ff6f.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libforeign_types_shared-df752d3167dea5b5.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libopenssl_sys-318a4e3e66f1a6ee.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/liburl-86cd9fa83e1a1581.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libidna-3c67f46cd2fd9473.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libunicode_normalization-66c1b9dd2294b8cb.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libtinyvec-b3ee1a4bcd5c100f.rlib" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libtinyvec_macros-bef6fe7e5df78f4b.rlib" "/Users/xiaoqiangjiang/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-c097b71320db773c.rlib" "/Users/xiaoqiangjiang/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-37d12500bef99331.rlib" "/Users/xiaoqiangjiang/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_core-63d6ff8598946320.rlib" "/Users/xiaoqiangjiang/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-972b93109ce1fa5e.rlib" "-Wl,--end-group" "/Users/xiaoqiangjiang/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-71972cde1db06d51.rlib" "-Wl,-Bdynamic" "-lssl" "-lcrypto" "-lpq" "-lgcc_s" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/Users/xiaoqiangjiang/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib" "-o" "/Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/fortune-66ee421a3d6e3b3c" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
= note: /opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.12.rcgu.o): in function `<diesel::pg::connection::row::PgRow as diesel::row::Row<diesel::pg::backend::Pg>>::take':
diesel.1e507974-cgu.12:(.text._ZN102_$LT$diesel..pg..connection..row..PgRow$u20$as$u20$diesel..row..Row$LT$diesel..pg..backend..Pg$GT$$GT$4take17hfcd5b9afa869e644E+0x27): undefined reference to `PQgetisnull'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.12:(.text._ZN102_$LT$diesel..pg..connection..row..PgRow$u20$as$u20$diesel..row..Row$LT$diesel..pg..backend..Pg$GT$$GT$4take17hfcd5b9afa869e644E+0x3e): undefined reference to `PQgetvalue'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.12:(.text._ZN102_$LT$diesel..pg..connection..row..PgRow$u20$as$u20$diesel..row..Row$LT$diesel..pg..backend..Pg$GT$$GT$4take17hfcd5b9afa869e644E+0x4f): undefined reference to `PQgetlength'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.13.rcgu.o): in function `<diesel::pg::connection::PgConnection as diesel::connection::Connection>::establish':
diesel.1e507974-cgu.13:(.text._ZN87_$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$9establish17h8aa49ec29366fe8bE+0x19f): undefined reference to `PQfinish'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.13:(.text._ZN87_$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$9establish17h8aa49ec29366fe8bE+0x26b): undefined reference to `PQsetNoticeProcessor'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.13:(.text._ZN87_$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$9establish17h8aa49ec29366fe8bE+0x32b): undefined reference to `PQfinish'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.13:(.text._ZN87_$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$9establish17h8aa49ec29366fe8bE+0x346): undefined reference to `PQfinish'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.13.rcgu.o): in function `<diesel::pg::connection::PgConnection as diesel::connection::Connection>::execute':
diesel.1e507974-cgu.13:(.text._ZN87_$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$7execute17hf7b1748aed6baae0E+0x1b4): undefined reference to `PQcmdTuples'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.13:(.text._ZN87_$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$7execute17hf7b1748aed6baae0E+0x1e5): undefined reference to `PQclear'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.13:(.text._ZN87_$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$7execute17hf7b1748aed6baae0E+0x29a): undefined reference to `PQclear'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `core::ptr::drop_in_place<diesel::pg::connection::result::PgErrorInformation>':
diesel.1e507974-cgu.3:(.text._ZN4core3ptr71drop_in_place$LT$diesel..pg..connection..result..PgErrorInformation$GT$17hc4253a47f03c3f62E+0x5): undefined reference to `PQclear'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `diesel::pg::connection::result::PgResult::new':
diesel.1e507974-cgu.3:(.text._ZN6diesel2pg10connection6result8PgResult3new17h94544362d159079fE+0x15): undefined reference to `PQresultStatus'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.3:(.text._ZN6diesel2pg10connection6result8PgResult3new17h94544362d159079fE+0xb3): undefined reference to `PQclear'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.3:(.text._ZN6diesel2pg10connection6result8PgResult3new17h94544362d159079fE+0xc6): undefined reference to `PQresultErrorField'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.3:(.text._ZN6diesel2pg10connection6result8PgResult3new17h94544362d159079fE+0x1c1): undefined reference to `PQclear'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `diesel::pg::connection::result::PgResult::num_rows':
diesel.1e507974-cgu.3:(.text._ZN6diesel2pg10connection6result8PgResult8num_rows17h699fffa9bd2b0118E+0x6): undefined reference to `PQntuples'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `<diesel::pg::connection::result::PgErrorInformation as diesel::result::DatabaseErrorInformation>::message':
diesel.1e507974-cgu.3:(.text._ZN111_$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$7message17he8420a61e14dc590E+0x14): undefined reference to `PQresultErrorField'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.3:(.text._ZN111_$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$7message17he8420a61e14dc590E+0x5b): undefined reference to `PQresultErrorMessage'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `<diesel::pg::connection::result::PgErrorInformation as diesel::result::DatabaseErrorInformation>::details':
diesel.1e507974-cgu.3:(.text._ZN111_$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$7details17h41d8af601be65cb3E+0xf): undefined reference to `PQresultErrorField'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `<diesel::pg::connection::result::PgErrorInformation as diesel::result::DatabaseErrorInformation>::hint':
diesel.1e507974-cgu.3:(.text._ZN111_$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$4hint17h046c6399f43601e1E+0xf): undefined reference to `PQresultErrorField'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `<diesel::pg::connection::result::PgErrorInformation as diesel::result::DatabaseErrorInformation>::table_name':
diesel.1e507974-cgu.3:(.text._ZN111_$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$10table_name17h07244da9a1cd207bE+0xf): undefined reference to `PQresultErrorField'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `<diesel::pg::connection::result::PgErrorInformation as diesel::result::DatabaseErrorInformation>::column_name':
diesel.1e507974-cgu.3:(.text._ZN111_$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$11column_name17h64121ff201f888e9E+0xf): undefined reference to `PQresultErrorField'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.3.rcgu.o): in function `<diesel::pg::connection::result::PgErrorInformation as diesel::result::DatabaseErrorInformation>::constraint_name':
diesel.1e507974-cgu.3:(.text._ZN111_$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$15constraint_name17h06c3e8fcc2f38e98E+0xf): undefined reference to `PQresultErrorField'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.6.rcgu.o): in function `diesel::pg::connection::stmt::Statement::execute':
diesel.1e507974-cgu.6:(.text._ZN6diesel2pg10connection4stmt9Statement7execute17h1df5513c7c4c4f77E+0x22f): undefined reference to `PQexecPrepared'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.6.rcgu.o): in function `diesel::pg::connection::stmt::Statement::prepare':
diesel.1e507974-cgu.6:(.text._ZN6diesel2pg10connection4stmt9Statement7prepare17h842bf72e23d6d98bE+0x208): undefined reference to `PQprepare'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.6:(.text._ZN6diesel2pg10connection4stmt9Statement7prepare17h842bf72e23d6d98bE+0x313): undefined reference to `PQclear'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.9.rcgu.o): in function `diesel::pg::connection::raw::RawConnection::establish':
diesel.1e507974-cgu.9:(.text._ZN6diesel2pg10connection3raw13RawConnection9establish17h4731f22e8f334bd1E+0x5f): undefined reference to `PQconnectdb'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.9:(.text._ZN6diesel2pg10connection3raw13RawConnection9establish17h4731f22e8f334bd1E+0x6b): undefined reference to `PQstatus'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: diesel.1e507974-cgu.9:(.text._ZN6diesel2pg10connection3raw13RawConnection9establish17h4731f22e8f334bd1E+0x88): undefined reference to `PQfinish'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.9.rcgu.o): in function `<diesel::pg::connection::raw::RawConnection as core::ops::drop::Drop>::drop':
diesel.1e507974-cgu.9:(.text._ZN84_$LT$diesel..pg..connection..raw..RawConnection$u20$as$u20$core..ops..drop..Drop$GT$4drop17h6af0303d0f1b6abfE+0x5): undefined reference to `PQfinish'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.9.rcgu.o): in function `_ZN6diesel2pg10connection3raw18last_error_message17h47198c771432cdf0E.llvm.5575034157405227121':
diesel.1e507974-cgu.9:(.text._ZN6diesel2pg10connection3raw18last_error_message17h47198c771432cdf0E.llvm.5575034157405227121+0x16): undefined reference to `PQerrorMessage'
/opt/homebrew/Cellar/musl-cross/0.9.9_1/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: /Users/xiaoqiangjiang/source/reddwarf/backend/fortune/target/x86_64-unknown-linux-musl/release/deps/libdiesel-5117ba9d7008b221.rlib(diesel-5117ba9d7008b221.diesel.1e507974-cgu.9.rcgu.o): in function `<diesel::pg::connection::raw::RawResult as core::ops::drop::Drop>::drop':
diesel.1e507974-cgu.9:(.text._ZN80_$LT$diesel..pg..connection..raw..RawResult$u20$as$u20$core..ops..drop..Drop$GT$4drop17hfdec9cc1e7a2917eE+0x5): undefined reference to `PQclear'
collect2: error: ld returned 1 exit status
= help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
warning: `fortune` (bin "fortune") generated 4 warnings
error: could not compile `fortune` due to previous error; 4 warnings emitted
why did this happen? what should I do to fixed this problem?

As for cross compile, probably you could give cargo-zigbuild a try.

Related

linker find conda installed library but struggles on its dependencies

Context:
I have updated my conda installed packages, among them gdal library.
Then I have to recompile TauDEM which is broken by the update of gdal.
Problem:
When I compile this program against the gdal library installed by conda, it find undefined references for all the dependencies of this gdal library (and are installed also by conda):
mpicxx -o ../bin/areadinf areadinfmn.o areadinf.o commonLib.o tiffIO.o ReadOutlets.o -L/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib -lgdal -L/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib -lnetcdf
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « GEOSMakeValidWithParams_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « sqlite3_rtree_query_callback »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFGetStrileByteCountWithErr »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_mime_data_cb »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSFrechetDistance »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_mime_filename »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFReadRGBATileExt »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_multi_poll »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFForceStrileArrayWriting »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_mime_free »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSVoronoiDiagram »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFDeferStrileArrayWriting »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « GEOSMakeValidParams_setMethod_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libpoppler.so.120 : undefined reference to « cmsGetEncodedCMMversion »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/librttopo.so.1 : undefined reference to « GEOSClipByRect_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSContext_setNoticeMessageHandler_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFReadFromUserBuffer »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « GEOSMakeValidParams_setKeepCollapsed_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFGetStrileOffset »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSContext_setErrorMessageHandler_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFGetStrileOffsetWithErr »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSFrechetDistance_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_mime_name »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « sqlite3_strlike »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSFrechetDistanceDensify »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libpng16.so.16 : undefined reference to « inflateValidate#ZLIB_1.2.9 »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « GEOSMakeValid_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_mime_data »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSFrechetDistanceDensify_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOS_init_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_mime_init »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « GEOSMakeValidParams_destroy_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFGetStrileByteCount »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « curl_mime_addpart »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOSVoronoiDiagram_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libspatialite.so.7 : undefined reference to « GEOS_finish_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « GEOSMakeValidParams_create_r »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « opj_encoder_set_extra_options »
/a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so : undefined reference to « TIFFReadRGBAStripExt »
Even if the system linker is able to find them:
$ lddtree /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so
libgdal.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libgdal.so (interpreter => none)
libcrypto.so.1.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libcrypto.so.1.1
libtiledb.so.2.9 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libtiledb.so.2.9
libbz2.so.1.0 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libbz2.so.1.0
libssl.so.1.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libssl.so.1.1
libpoppler.so.120 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libpoppler.so.120
libfreetype.so.6 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libfreetype.so.6
libfontconfig.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libfontconfig.so.1
liblcms2.so.2 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././liblcms2.so.2
libnss3.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libnss3.so
libnssutil3.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./././libnssutil3.so
libplds4.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./././libplds4.so
libsmime3.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libsmime3.so
libplc4.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libplc4.so
libnspr4.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libnspr4.so
libjson-c.so.5 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libjson-c.so.5
libfreexl.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libfreexl.so.1
libgeos_c.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libgeos_c.so.1
libgeos.so.3.10.3 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libgeos.so.3.10.3
libwebp.so.7 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libwebp.so.7
libkmlbase.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libkmlbase.so.1
libminizip.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libminizip.so
liburiparser.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././liburiparser.so
libkmldom.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libkmldom.so.1
libkmlengine.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libkmlengine.so.1
libkmlxsd.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libkmlxsd.so.1
libkmlregionator.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libkmlregionator.so.1
libkmlconvenience.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libkmlconvenience.so.1
libexpat.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libexpat.so.1
libxerces-c-3.2.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libxerces-c-3.2.so
libnsl.so.3 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libnsl.so.3
libicui18n.so.70 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libicui18n.so.70
libicuuc.so.70 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libicuuc.so.70
libicudata.so.70 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libicudata.so.70
libopenjp2.so.7 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libopenjp2.so.7
libnetcdf.so.19 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libnetcdf.so.19
libhdf5_hl.so.200 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libhdf5_hl.so.200
libzip.so.5 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libzip.so.5
libmfhdf.so.0 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libmfhdf.so.0
libdf.so.0 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libdf.so.0
libgif.so.7 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libgif.so.7
libgeotiff.so.5 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libgeotiff.so.5
libpng16.so.16 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libpng16.so.16
libcfitsio.so.9 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libcfitsio.so.9
libpq.so.5 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libpq.so.5
libgssapi_krb5.so.2 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libgssapi_krb5.so.2
libkrb5.so.3 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./././libkrb5.so.3
libk5crypto.so.3 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./././libk5crypto.so.3
libcom_err.so.3 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./././libcom_err.so.3
libkrb5support.so.0 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./././libkrb5support.so.0
libkeyutils.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./././libkeyutils.so.1
libresolv.so.2 => /usr/lib64/libresolv.so.2
liblz4.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./liblz4.so.1
libblosc.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libblosc.so.1
libsnappy.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libsnappy.so.1
libzstd.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libzstd.so.1
liblzma.so.5 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./liblzma.so.5
libproj.so.25 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libproj.so.25
libsqlite3.so.0 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libsqlite3.so.0
libtiff.so.5 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libtiff.so.5
libjpeg.so.9 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libjpeg.so.9
libdeflate.so.0 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libdeflate.so.0
libz.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libz.so.1
libpthread.so.0 => /usr/lib64/libpthread.so.0
librt.so.1 => /usr/lib64/librt.so.1
libdl.so.2 => /usr/lib64/libdl.so.2
libspatialite.so.7 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libspatialite.so.7
librttopo.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././librttopo.so.1
libcharset.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libcharset.so.1
libpcre.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libpcre.so.1
libLerc.so => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libLerc.so
libcurl.so.4 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libcurl.so.4
libnghttp2.so.14 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libnghttp2.so.14
libssh2.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/././libssh2.so.1
libiconv.so.2 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libiconv.so.2
libxml2.so.2 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libxml2.so.2
libkea.so.1.4 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libkea.so.1.4
libhdf5_cpp.so.200 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libhdf5_cpp.so.200
libhdf5.so.200 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libhdf5.so.200
libstdc++.so.6 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libstdc++.so.6
libm.so.6 => /usr/lib64/libm.so.6
libc.so.6 => /usr/lib64/libc.so.6
ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2
libgcc_s.so.1 => /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libgcc_s.so.1
Of course I have check that all the missing symbols are well defined in those libraries :
$ nm /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/./libgeos_c.so.1 | grep GEOS_init_r
000000000001eac0 T GEOS_init_r
0000000000013270 t GEOS_init_r.cold
$ nm /a2s/a2s_platform_2/A2S/miniconda3/envs/a2s_env/lib/libcurl.so.4 | grep curl_mime_data
000000000003e320 T curl_mime_data
000000000003e810 T curl_mime_data_cb
Has someone a solution to solve this nightmare ?
i.e. maybe just a way to tell the compiler to ignore those unresolved symbols as the system linker knows where to find the gdal dependencies ?
I am completely stuck, thanks for your help.

Cannot read property 'name' of undefined discord.js

I have an error with the help command, the error is
<rejected> TypeError: Cannot read property 'name' of undefined
at /home/runner/mUdollar1cB0t/commands/help.js:16:55
client.commands.forEach(cmd => {
let cmdinfo = cmd.info
allcmds+="`" + client.config.prefix + cmdinfo.name+" " + cmdinfo.usage+"` ~ " + cmdinfo.description+"\n"
})
is the code I don't know what's wrong.
In your code, cmdinfo is undefined, you need to verify if you have some data in cmd.info to proceed with your code.

How to use typeof in Object.prototype

I've created an object prototype, and am trying to check the 'typeof' 'this', but it always returns 'object'.
Object.prototype.testme = function() { return typeof this }
And then
'test'.testme(); // returns 'object' instead of 'string'
So in the prototype, if I add
console.log(this)
I get:
[String: 'test']
How do I just test the value with typeof in a prototype? I know I can define prototypes based on the type, but I need a catchall as there will be null values etc...?

TypeError: Cannot read property 'Grid' of undefined thrown in Table.forceUpdateGrid

I am attempting to call tableInstance.forceUpdateGrid() inside a Promise.then() callback and it is throwing an exception TypeError: Cannot read property 'Grid' of undefined
Looking at the following code
_createClass(Table, [{
key: 'forceUpdateGrid',
value: function forceUpdateGrid() {
this.Grid.forceUpdate();
}
the this reference is undefined...
the only thing I can think of is that in-between the initial BE api call and the Promise.then() handler, there has been a props change that has caused the containing component to re-render and maybe the tableInstance reference no longer points to the correct instance?
Can anyone help?
(1) Use fat arrow functions to get this reference inside function :-
_createClass(Table, [{
key: 'forceUpdateGrid',
value: forceUpdateGrid = () => {
this.Grid.forceUpdate();
}
(2)Or,
let thisRef = this;
_createClass(Table, [{
key: 'forceUpdateGrid',
value: function forceUpdateGrid() {
thisRef.Grid.forceUpdate();
}
i hope it helps!

How to extend built-in function/add a property to a function?

process.hrtime.bigint() does not exist in the standard lib. I'm trying to add it in.
Here's what I've got:
types/bigint.d.ts
// https://github.com/Microsoft/TypeScript/issues/15096#issuecomment-400186862
type BigInt = number
declare const BigInt: typeof Number;
declare namespace NodeJS {
export interface Process {
hrtime: HighResTime
}
export interface HighResTime {
(time?: [number, number]): [number, number];
bigint(): BigInt
}
}
Which I've added to my typeRoots in tsconfig.json:
"typeRoots": ["./node_modules/#types","./types"]
Using like:
///<reference path="../types/bigint.d.ts"/>
export default class ProgressBar {
private startTime?: BigInt;
start() {
this.startTime = process.hrtime.bigint();
this.render();
}
But I get:
/home/me/Projects/xxx/node_modules/ts-node/src/index.ts:261
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
src/ProgressBar.ts(19,41): error TS2339: Property 'bigint' does not exist on type '(time?: [number, number] | undefined) => [number, number]'.
If I remove the <reference> to bigint.d.ts then it gets even worse, and complains the type BigInt doesn't exist (TS2304) -- which doesn't make much sense to me, i thought that was the point of the typeRoot?
But the bigger issue is that even with the reference, TS still doesn't like process.hrtime.bigint(), so I'm guessing I didn't extend the Process interface properly. How do I do it right?

Resources