Could no longer compile and build Rust (1.46 and 1.47) apps on FreeBSD (12.1)

I used to be able to compile and build Rust programs on FreeBSD easily with the command "cargo build --release", but now I'm hit with the error:

  = note: ld: error: unable to find library -lpq
      cc: error: linker command failed with exit code 1 (use -v to see invocation)

The full extract of the error (from the last successful crate compile until the end):

...
Compiling actix-cors v0.1.0
Running rustc --crate-name actix_cors --edition=2018 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-cors-0.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembed-bitcode=no -C metadata=23dc57b9df1ec180 -C extra-filename=-23dc57b9df1ec180 --out-dir /usr/local/rustapps/hello_server/target/release/deps -L dependency=/usr/local/rustapps/hello_server/target/release/deps --extern actix_service=/usr/local/rustapps/hello_server/target/release/deps/libactix_service-bb1e7f8c8a88c651.rmeta --extern actix_web=/usr/local/rustapps/hello_server/target/release/deps/libactix_web-b7a05c25c6fa6062.rmeta --extern derive_more=/usr/local/rustapps/hello_server/target/release/deps/libderive_more-992118eaafa9b4d1.so --extern futures=/usr/local/rustapps/hello_server/target/release/deps/libfutures-fdf705743c1ed243.rmeta --cap-lints allow -L native=/usr/local/rustapps/hello_server/target/release/build/backtrace-sys-34f2cc8fe7435fb2/out -L native=/usr/local/rustapps/hello_server/target/release/build/brotli-sys-24141b360a757a36/out -L native=/usr/local/rustapps/hello_server/target/release/build/miniz-sys-cc583c3c10d62897/out
Compiling hello_server v0.1.0 (/usr/local/rustapps/hello_server)
Running rustc --crate-name hello_server --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C metadata=e595c31669b3baa9 -C extra-filename=-e595c31669b3baa9 --out-dir /usr/local/rustapps/hello_server/target/release/deps -L dependency=/usr/local/rustapps/hello_server/target/release/deps --extern actix_cors=/usr/local/rustapps/hello_server/target/release/deps/libactix_cors-23dc57b9df1ec180.rlib --extern actix_web=/usr/local/rustapps/hello_server/target/release/deps/libactix_web-b7a05c25c6fa6062.rlib --extern diesel=/usr/local/rustapps/hello_server/target/release/deps/libdiesel-3939d79bdba68e12.rlib --extern dotenv=/usr/local/rustapps/hello_server/target/release/deps/libdotenv-082197adca00ed90.rlib --extern futures=/usr/local/rustapps/hello_server/target/release/deps/libfutures-fdf705743c1ed243.rlib --extern jsonwebtoken=/usr/local/rustapps/hello_server/target/release/deps/libjsonwebtoken-36bd59710de42427.rlib --extern lazy_static=/usr/local/rustapps/hello_server/target/release/deps/liblazy_static-831d5db5eb751613.rlib --extern lettre=/usr/local/rustapps/hello_server/target/release/deps/liblettre-ca9cc94a885804a0.rlib --extern lettre_email=/usr/local/rustapps/hello_server/target/release/deps/liblettre_email-4d13004ac7ca7d12.rlib --extern native_tls=/usr/local/rustapps/hello_server/target/release/deps/libnative_tls-2922ad1836a60820.rlib --extern r2d2=/usr/local/rustapps/hello_server/target/release/deps/libr2d2-bb3d3c8cd437766a.rlib --extern rand=/usr/local/rustapps/hello_server/target/release/deps/librand-dab5180c4632ea42.rlib --extern argon2=/usr/local/rustapps/hello_server/target/release/deps/libargon2-1925926c3b130442.rlib --extern serde=/usr/local/rustapps/hello_server/target/release/deps/libserde-055f8ffae0dc8f79.rlib --extern serde_json=/usr/local/rustapps/hello_server/target/release/deps/libserde_json-91054423704f4928.rlib --extern time=/usr/local/rustapps/hello_server/target/release/deps/libtime-c0258ece1aca64ab.rlib -L native=/usr/local/rustapps/hello_server/target/release/build/backtrace-sys-34f2cc8fe7435fb2/out -L native=/usr/local/rustapps/hello_server/target/release/build/brotli-sys-24141b360a757a36/out -L native=/usr/local/rustapps/hello_server/target/release/build/miniz-sys-cc583c3c10d62897/out -L native=/usr/local/rustapps/hello_server/target/release/build/ring-7d33578caf87bece/out -L native=/usr/lib
error: linking with cc failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.0.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.1.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.10.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.11.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.12.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.13.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.14.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.15.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.2.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.3.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.4.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.5.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.6.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.7.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.8.rcgu.o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.hello_server.cag0vuyg-cgu.9.rcgu.o" "-o" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9" "/usr/local/rustapps/hello_server/target/release/deps/hello_server-e595c31669b3baa9.2xawlbqul5qshqe6.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/usr/local/rustapps/hello_server/target/release/deps" "-L" "/usr/local/rustapps/hello_server/target/release/build/backtrace-sys-34f2cc8fe7435fb2/out" "-L" "/usr/local/rustapps/hello_server/target/release/build/brotli-sys-24141b360a757a36/out" "-L" "/usr/local/rustapps/hello_server/target/release/build/miniz-sys-cc583c3c10d62897/out" "-L" "/usr/local/rustapps/hello_server/target/release/build/ring-7d33578caf87bece/out" "-L" "/usr/lib" "-L" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib" "-Wl,-Bstatic" "/usr/local/rustapps/hello_server/target/release/deps/libactix_cors-23dc57b9df1ec180.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_web-b7a05c25c6fa6062.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libawc-63c4f04c5c8093b1.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_testing-a5d85f202fa39917.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_server-bfdd75378a741be4.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_signal-6cae5520952411a1.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libsignal_hook-9078c1deaf5bdd63.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libsignal_hook_registry-71b22e1f4689bf31.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libarc_swap-33690da36d8343e3.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libmio_uds-e9340a4175219bab.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_router-b5ad76d5aad79328.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_http-6d49625c6a7f8554.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libsha1-22021381febae92b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libserde_urlencoded-0f4f0d2ea30422c3.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liburl-f1a3344c499ef84d.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libidna-2cb48704f207003a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libdtoa-03943e2aa8d97280.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libhttparse-2aeb1f3af4fcad59.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libencoding_rs-87b421f280bfc199.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblanguage_tags-d430c6a2e15195f0.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libpercent_encoding-d4ba1f0fd5ee76e9.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libflate2-f0871830dc1e49eb.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libminiz_sys-fccd829ea85b84aa.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libcrc32fast-97398f2a62cf9775.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbrotli2-c1eca046a9115978.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbrotli_sys-d16c9e143b6804e2.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libhashbrown-63b194a2a6601ee8.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_utils-dbc84e18161297c9.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_connect-4a56eb8ccfcb20db.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_rt-49519134a4ba33e9.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_threadpool-e35e798ff8d0863a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libthreadpool-3dfe7781ffef4352.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libcopyless-77360503c2223a62.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_current_thread-c7980d5b1d38176a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtrust_dns_resolver-224d325608fb094b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtrust_dns_proto-aaf9fb5cea435a61.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liburl-83237033a40b1543.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libpercent_encoding-1d66fbbb72626af0.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_udp-1aa8e379e86b1150.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_timer-d0151e53a1034b61.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libsocket2-ec16b5fc8093302a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libidna-d5d5823d842f86e9.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libunicode_normalization-ab19b221730f25d5.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libunicode_bidi-1b7f4f9d9ac5d809.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libmatches-87a5cd8e9977c166.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libresolv_conf-1e463c4855594a0e.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libquick_error-a56b7680022221e9.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblru_cache-2f4bee6a277c3842.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblinked_hash_map-132c64827aed833f.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libeither-5fe426bc521c7daf.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libh2-a5baa8c62513309b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libindexmap-33d3de7c90a37012.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libstring-737e74afc37dee1f.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libhttp-634cd85f3393a717.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_service-bb1e7f8c8a88c651.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_server_config-3da3c37227e0574e.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_tcp-b7efa74571a59730.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_reactor-5edba4ab42b8d257.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_sync-cf92e80fae5451ad.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libfnv-d42f05c36f0b6793.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_executor-6cef470e7d32e7e0.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libnum_cpus-14b320fc49da2263.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libmio-528e7bae96a5e18e.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libslab-fc9f59c5604897d8.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libnet2-3ea858bd6ac47f43.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libactix_codec-4d72c42b2d3f7b7a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_codec-0a51b15f1be6cb8f.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtokio_io-9ec59bda5fd36656.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbytes-f2fce8ce5e13754d.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libiovec-cdb1aa7b5919bf35.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libjsonwebtoken-36bd59710de42427.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libring-3b323c44d40b5148.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libspin-bf773dce8f373217.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libuntrusted-3ed6d80e715beaf3.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libargon2-1925926c3b130442.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libcrossbeam_utils-58069a0cb2f9bb62.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libblake2b_simd-51f7c19dec650b30.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libconstant_time_eq-705e7c316c524b3f.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libarrayvec-cbb40ce3bea40738.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libnodrop-63ef7a8362093d4b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libarrayref-7dd89bec2ff36735.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand-dab5180c4632ea42.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_chacha-7bb8d4af69673e6a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libc2_chacha-0b5bd7d6adbbe9c0.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libppv_lite86-49470f5b04cf39b5.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_core-7d5ac4a4947d793b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libgetrandom-e0687db72d8e9e92.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblettre_email-4d13004ac7ca7d12.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libmime-1b6503990161bb00.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libuuid-4ee667c441d7384a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand-026b89e6c3d77d3f.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_xorshift-1d15d4d092d94c88.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_pcg-cafe50b7183ee257.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_hc-88a59ef6a8df4ce1.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_chacha-a6e8bca1c6f31901.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_isaac-f6ca44efe4a36283.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_core-58555d18a797fbee.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_os-cdd2f54b0970d530.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_jitter-f9452906f10c83b3.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand_core-0995e04316004876.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libemail-e7f6b4b2679bfd02.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librand-e2ab564ff395e9c4.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libchrono-8757293a563ccb35.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libnum_integer-8dd2f8db824bbd39.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libnum_traits-f55998c8a465123e.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libtime-c0258ece1aca64ab.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libencoding-530a85e0c7e8f529.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libencoding_index_tradchinese-acbe7899e7daa462.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libencoding_index_simpchinese-80750449533d5ecb.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libencoding_index_japanese-c1b61b98edc3df6c.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libencoding_index_korean-1ba9013f78d57846.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libencoding_index_singlebyte-8e4d70044a387fa4.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbase64-553fc820e83121e5.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libsafemem-35d44ee89a83dd42.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblettre-ca9cc94a885804a0.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libfast_chemail-96be7595c33e4ad8.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libascii_utils-fe2df0ebd4d759f5.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libserde_json-91054423704f4928.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libryu-55270a9c888d5adb.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libitoa-a60c26da3041691b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libserde-055f8ffae0dc8f79.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libnom-56a47f4c04a9868b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libnative_tls-2922ad1836a60820.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libopenssl_probe-eab5781da7adf67b.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libopenssl-456671477afb143f.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libopenssl_sys-10c81d36d8d822dd.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libforeign_types-511a3cb40440354a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libforeign_types_shared-5d3bbdd224ec0f59.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libhostname-625b2988c8d020d3.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbufstream-27f39b3cb77228b3.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbase64-cfa6bd06f3a0a88c.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libfutures-fdf705743c1ed243.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libdotenv-082197adca00ed90.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libfailure-d15658748ed2b08e.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbacktrace-4458d31dc89b12e4.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbacktrace_sys-fd412833661a8121.rlib" "/usr/local/rustapps/hello_server/target/release/deps/librustc_demangle-c5e3c3d280407e25.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libregex-9306ee76e54484e7.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libthread_local-2b05d0dc6cfab590.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblazy_static-831d5db5eb751613.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libregex_syntax-9044e972a0dd518c.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libaho_corasick-4c5fa0c6f0502e7c.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libmemchr-de6c2901bb1ab9d2.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libdiesel-3939d79bdba68e12.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libpq_sys-dadafcb0286b1926.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libr2d2-bb3d3c8cd437766a.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libscheduled_thread_pool-9494bc31b946c528.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libparking_lot-58cf7eed5d76365c.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libparking_lot_core-fa9e41c94f25c9dc.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblibc-e65e1ee6eddd97b8.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libsmallvec-e1cbc5900853b9af.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblock_api-2625b4e63414e119.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libscopeguard-a51df8e94aa270be.rlib" "/usr/local/rustapps/hello_server/target/release/deps/liblog-2994e990b9071b46.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libcfg_if-f511acca7b1a06bc.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbyteorder-a73eeb6688b161e0.rlib" "/usr/local/rustapps/hello_server/target/release/deps/libbitflags-b8f57b363afb4451.rlib" "-Wl,--start-group" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-aeb3e06882dce448.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libpanic_unwind-279d0d6512ac7876.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libhashbrown-1e89f25960778500.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_alloc-c3b6b03846a780e1.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libbacktrace-a544c6e7dd68e0a2.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libbacktrace_sys-87233b22d2581215.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_demangle-10ff2ad20a639081.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libunwind-306bbe846a8a7b4d.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libcfg_if-3187a6541c83c4c2.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/liblibc-8f01d7df5dc42551.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/liballoc-a43eed55684f109c.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_core-9b1ac11f7146e354.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libcore-5f06c2e98a85ebfd.rlib" "-Wl,--end-group" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libcompiler_builtins-b9588e5011d9051d.rlib" "-Wl,-Bdynamic" "-lssl" "-lcrypto" "-lpq" "-lutil" "-lutil" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: ld: error: unable to find library -lpq
cc: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error

error: could not compile hello_server.

Caused by:
process didn't exit successfully: rustc --crate-name hello_server --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C metadata=e595c31669b3baa9 -C extra-filename=-e595c31669b3baa9 --out-dir /usr/local/rustapps/hello_server/target/release/deps -L dependency=/usr/local/rustapps/hello_server/target/release/deps --extern actix_cors=/usr/local/rustapps/hello_server/target/release/deps/libactix_cors-23dc57b9df1ec180.rlib --extern actix_web=/usr/local/rustapps/hello_server/target/release/deps/libactix_web-b7a05c25c6fa6062.rlib --extern diesel=/usr/local/rustapps/hello_server/target/release/deps/libdiesel-3939d79bdba68e12.rlib --extern dotenv=/usr/local/rustapps/hello_server/target/release/deps/libdotenv-082197adca00ed90.rlib --extern futures=/usr/local/rustapps/hello_server/target/release/deps/libfutures-fdf705743c1ed243.rlib --extern jsonwebtoken=/usr/local/rustapps/hello_server/target/release/deps/libjsonwebtoken-36bd59710de42427.rlib --extern lazy_static=/usr/local/rustapps/hello_server/target/release/deps/liblazy_static-831d5db5eb751613.rlib --extern lettre=/usr/local/rustapps/hello_server/target/release/deps/liblettre-ca9cc94a885804a0.rlib --extern lettre_email=/usr/local/rustapps/hello_server/target/release/deps/liblettre_email-4d13004ac7ca7d12.rlib --extern native_tls=/usr/local/rustapps/hello_server/target/release/deps/libnative_tls-2922ad1836a60820.rlib --extern r2d2=/usr/local/rustapps/hello_server/target/release/deps/libr2d2-bb3d3c8cd437766a.rlib --extern rand=/usr/local/rustapps/hello_server/target/release/deps/librand-dab5180c4632ea42.rlib --extern argon2=/usr/local/rustapps/hello_server/target/release/deps/libargon2-1925926c3b130442.rlib --extern serde=/usr/local/rustapps/hello_server/target/release/deps/libserde-055f8ffae0dc8f79.rlib --extern serde_json=/usr/local/rustapps/hello_server/target/release/deps/libserde_json-91054423704f4928.rlib --extern time=/usr/local/rustapps/hello_server/target/release/deps/libtime-c0258ece1aca64ab.rlib -L native=/usr/local/rustapps/hello_server/target/release/build/backtrace-sys-34f2cc8fe7435fb2/out -L native=/usr/local/rustapps/hello_server/target/release/build/brotli-sys-24141b360a757a36/out -L native=/usr/local/rustapps/hello_server/target/release/build/miniz-sys-cc583c3c10d62897/out -L native=/usr/local/rustapps/hello_server/target/release/build/ring-7d33578caf87bece/out -L native=/usr/lib (exit code: 1)
root@hello_server:/usr/local/rustapps/hello_server # which lpq
/usr/bin/lpq

What can I do?

I google and saw this. How do I set those CFLAGS?

That issue is about cross-compiling, which you don't seem to do. In your case you need to install libpq. This is the postgresql client library. sudo pkg install postgresql13-client should do the trick I think. You may also need to install postgresql13-server if you don't already have a postgresql server.

1 Like

Amazing! That worked! You're a great guy! Thanks!