Rust debugging with JetBrains CLion IDE on Windows - debugging

I'm trying to get Rust debugging to work with the JetBrains debugger.
Similar to this question, I noticed the MSVC toolchain isn't supported. I follow the instructions available there and in the JetBrains blog, and get a hello world program to debug, using a Cygwin toolchain for running and debugging.
However, whenever I use a crate that has, as I believe, bindings to native C/C++, the linker fails. This output is the output received when trying to use the ssh2 crate and running the command D:/Programs/Rust/Cargo/bin/cargo.exe run --color=always --package rust_manual --bin rust_manual --verbose (without the 80 preceding warnings):
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
|
= note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "D:\\Programs\\
Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "D:\\
Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.2il83ncbprx9skxc.rcgu.o" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.2tkb1dtkdvpzvru8.rcgu.o" "D:\\Documents\\rust_manual\\
target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.38mlr7whhiedxpa9.rcgu.o" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.3mv2p2964hms7hcw.rcgu.o" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rus
t_manual-e02c4017dbb04ce1.oyp82k1tv9dpo03.rcgu.o" "-o" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.exe" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.1n9qmwpghqvw10
ei.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\\Documents\\rust_manual\\target\\debug\\deps" "-L" "D:\\Programs\\Rust\\Cargo\\registry\\src\\github.com-1ecc6299db9ec823\\winapi-x86_64-pc-windows-gnu-0.4.0\\lib" "-L" "D:\\D
ocuments\\rust_manual\\target\\debug\\build\\libssh2-sys-611fa0ef83ad9897\\out\\build" "-L" "D:\\Documents\\rust_manual\\target\\debug\\build\\libz-sys-0bd5febd50380866\\out\\build" "-L" "D:\\Programs\\Rust\\Rustup\\toolchains\\stab
le-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "D:\\Documents\\rust_manual\\target\\debug\\deps\\liblinked_hash_map-8ccaf07e1678ba81.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libfs2-
7cdf4dce3545590b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libaes_gcm_siv-7f08f4ec229f0194.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libaes-9e69959843670351.rlib" "D:\\Documents\\rust_manual\\target\\debu
g\\deps\\libaes_soft-85e91b74f1d42369.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libbyteorder-59f20df4b329d08b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libopaque_debug-77ca4cb51d8100fa.rlib" "D:\\Document
s\\rust_manual\\target\\debug\\deps\\libzeroize-bab8662dce816576.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libpolyval-0f2876d6fb299760.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libuniversal_hash-295cab4c7
b6658eb.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libsubtle-19f12b0836f68a71.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libaead-ef3c7269241d4b63.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libb
lock_cipher-662444e0b79f5644.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libgeneric_array-8edaebd677632f76.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libtypenum-1251f48f890b7d62.rlib" "D:\\Documents\\rust_ma
nual\\target\\debug\\deps\\libserde_json-53f81e6916eb8e26.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libryu-c8e41e31d4a509cb.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libitoa-903fb6c5622b5617.rlib" "D:\\Do
cuments\\rust_manual\\target\\debug\\deps\\libserde-4d09c2dcdbb1d8b3.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libssh2-7df6425f87af870e.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libparking_lot-07aaede0978
bcf2e.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libparking_lot_core-476c2f592babd25d.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libsmallvec-5b2a8d31eb1a4c6d.rlib" "D:\\Documents\\rust_manual\\target\\debug
\\deps\\liblock_api-7a323e635f8733ad.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libscopeguard-6c6d401b1f6f82b5.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib" "D:\\Documents
\\rust_manual\\target\\debug\\deps\\liblibz_sys-5c6fdfaf87470695.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\librand-952ff6682f89685d.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\librand_chacha-0619462aab8ab8c
f.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libppv_lite86-dc7a8f001990536b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\librand_core-29c3a2129db92df7.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\l
ibgetrandom-60ce90fab31a9998.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libnotify-a3f8496c1768c614.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libwalkdir-01728b165c663904.rlib" "D:\\Documents\\rust_manual\\t
arget\\debug\\deps\\libsame_file-bade0aa981bdf286.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libwinapi_util-aa42252baaa29f06.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibc-408386b57fa89aa8.rlib" "D:\\Do
cuments\\rust_manual\\target\\debug\\deps\\libfiletime-85a1a02ff2eb4f83.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libwinapi-fc941a2b370d489b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libcfg_if-cf58d0d3cd0
e6fed.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libbitflags-288950b807dfd7f7.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libbase64-e64b24a18f7239bc.rlib" "-Wl,--start-group" "D:\\Programs\\Rust\\Rustup\\too
lchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-447f0e6919e87703.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic
_unwind-6691a7d28fd5ead6.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-ee4714732ebaf9a3.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_
64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-e062de0dbb254b6a.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libbac
ktrace-2bc81dc380687e4b.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libbacktrace_sys-53b5dac028b62d7c.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x
86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-cb491f3ffc25ac52.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-9499
c77410f0cb84.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcfg_if-cb2a1962c04b6646.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-g
nu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-c582a1654a681be9.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-2285fe2f7f9a72ec.rlib" "D:\\Progr
ams\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_core-1a51942af531248c.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\ru
stlib\\x86_64-pc-windows-gnu\\lib\\libcore-d7ecf429ccc8dc70.rlib" "-Wl,--end-group" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-4fc9e886634ace
c6.rlib" "-Wl,-Bdynamic" "-lbcrypt" "-lcrypt32" "-luser32" "-lntdll" "-ladvapi32" "-lwinapi_advapi32" "-lwinapi_cfgmgr32" "-lwinapi_fwpuclnt" "-lwinapi_gdi32" "-lwinapi_kernel32" "-lwinapi_msimg32" "-lwinapi_ntdll" "-lwinapi_opengl3
2" "-lwinapi_synchronization" "-lwinapi_user32" "-lwinapi_winspool" "-lwinapi_ws2_32" "-ladvapi32" "-lws2_32" "-luserenv" "-lmingwex" "-lmingw32" "-lmsvcrt" "-lmsvcrt" "-luser32" "-lkernel32" "-lgcc_eh" "-l:libpthread.a" "-lgcc" "-l
msvcrt" "-lkernel32" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
= note: ld: cannot find -lntdll
error: aborting due to previous error; 80 warnings emitted
error: could not compile `rust_manual`.
Caused by:
process didn't exit successfully: `rustc --crate-name rust_manual --edition=2018 src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e02c4017dbb04ce1 -C
extra-filename=-e02c4017dbb04ce1 --out-dir D:\Documents\rust_manual\target\debug\deps -C incremental=D:\Documents\rust_manual\target\debug\incremental -L dependency=D:\Documents\rust_manual\target\debug\deps --extern aes_gcm=D:\Docu
ments\rust_manual\target\debug\deps\libaes_gcm-46686bd39b60c02f.rlib --extern aes_gcm_siv=D:\Documents\rust_manual\target\debug\deps\libaes_gcm_siv-7f08f4ec229f0194.rlib --extern base64=D:\Documents\rust_manual\target\debug\deps\lib
base64-e64b24a18f7239bc.rlib --extern fs2=D:\Documents\rust_manual\target\debug\deps\libfs2-7cdf4dce3545590b.rlib --extern linked_hash_map=D:\Documents\rust_manual\target\debug\deps\liblinked_hash_map-8ccaf07e1678ba81.rlib --extern
notify=D:\Documents\rust_manual\target\debug\deps\libnotify-a3f8496c1768c614.rlib --extern rand=D:\Documents\rust_manual\target\debug\deps\librand-952ff6682f89685d.rlib --extern rand_core=D:\Documents\rust_manual\target\debug\deps\l
ibrand_core-29c3a2129db92df7.rlib --extern serde=D:\Documents\rust_manual\target\debug\deps\libserde-4d09c2dcdbb1d8b3.rlib --extern serde_json=D:\Documents\rust_manual\target\debug\deps\libserde_json-53f81e6916eb8e26.rlib --extern s
sh2=D:\Documents\rust_manual\target\debug\deps\libssh2-7df6425f87af870e.rlib -L native=D:\Programs\Rust\Cargo\registry\src\github.com-1ecc6299db9ec823\winapi-x86_64-pc-windows-gnu-0.4.0\lib -L native=D:\Documents\rust_manual\target\
debug\build\libssh2-sys-611fa0ef83ad9897\out\build -L native=D:\Documents\rust_manual\target\debug\build\libz-sys-0bd5febd50380866\out\build` (exit code: 1)
The reason for this error, I believe, is summarized in the GCC-WARNING.txt file:
gcc.exe contained in this folder cannot be used for compiling C files - it is only used as a linker. In order to be able to compile projects containing C code use the GCC provided by MinGW or Cygwin.
I tried setting the toolchain to use the correct linker. The cargo documentation says that the config file allows me to do this with the following lines:
[target.x86_64-pc-windows-gnu]
linker = "D:\\Programs\\Cygwin\\bin\\gcc.exe"
Again, this works fine without the ssh2 crate, but fails with the following output when the crate is enabled;
error: linking with `D:\Programs\Cygwin\bin\gcc.exe` failed: exit code: 1
|
= note: "D:\\Programs\\Cygwin\\bin\\gcc.exe" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "D:
\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu
\\lib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.2il83ncbprx9skxc.rcgu.o" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.2tkb1dtkdvpzvru8.rcgu.o" "D:\\Documents\\r
ust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.38mlr7whhiedxpa9.rcgu.o" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.3mv2p2964hms7hcw.rcgu.o" "D:\\Documents\\rust_manual\\target\\debu
g\\deps\\rust_manual-e02c4017dbb04ce1.oyp82k1tv9dpo03.rcgu.o" "-o" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.exe" "D:\\Documents\\rust_manual\\target\\debug\\deps\\rust_manual-e02c4017dbb04ce1.1n
9qmwpghqvw10ei.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\\Documents\\rust_manual\\target\\debug\\deps" "-L" "D:\\Programs\\Rust\\Cargo\\registry\\src\\github.com-1ecc6299db9ec823\\winapi-x86_64-pc-windows-gnu-0.4.0\\lib"
"-L" "D:\\Documents\\rust_manual\\target\\debug\\build\\libssh2-sys-611fa0ef83ad9897\\out\\build" "-L" "D:\\Documents\\rust_manual\\target\\debug\\build\\libz-sys-0bd5febd50380866\\out\\build" "-L" "D:\\Programs\\Rust\\Rustup\\tool
chains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "D:\\Documents\\rust_manual\\target\\debug\\deps\\liblinked_hash_map-8ccaf07e1678ba81.rlib" "D:\\Documents\\rust_manual\\target\\debug\\d
eps\\libfs2-7cdf4dce3545590b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libaes_gcm_siv-7f08f4ec229f0194.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libaes-9e69959843670351.rlib" "D:\\Documents\\rust_manual\\
target\\debug\\deps\\libaes_soft-85e91b74f1d42369.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libbyteorder-59f20df4b329d08b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libopaque_debug-77ca4cb51d8100fa.rlib" "
D:\\Documents\\rust_manual\\target\\debug\\deps\\libzeroize-bab8662dce816576.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libpolyval-0f2876d6fb299760.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libuniversal_ha
sh-295cab4c7b6658eb.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libsubtle-19f12b0836f68a71.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libaead-ef3c7269241d4b63.rlib" "D:\\Documents\\rust_manual\\target\\debug
\\deps\\libblock_cipher-662444e0b79f5644.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libgeneric_array-8edaebd677632f76.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libtypenum-1251f48f890b7d62.rlib" "D:\\Docume
nts\\rust_manual\\target\\debug\\deps\\libserde_json-53f81e6916eb8e26.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libryu-c8e41e31d4a509cb.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libitoa-903fb6c5622b5617.r
lib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libserde-4d09c2dcdbb1d8b3.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libssh2-7df6425f87af870e.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libparking_lot
-07aaede0978bcf2e.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libparking_lot_core-476c2f592babd25d.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libsmallvec-5b2a8d31eb1a4c6d.rlib" "D:\\Documents\\rust_manual\\t
arget\\debug\\deps\\liblock_api-7a323e635f8733ad.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libscopeguard-6c6d401b1f6f82b5.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib" "D
:\\Documents\\rust_manual\\target\\debug\\deps\\liblibz_sys-5c6fdfaf87470695.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\librand-952ff6682f89685d.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\librand_chacha-061
9462aab8ab8cf.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libppv_lite86-dc7a8f001990536b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\librand_core-29c3a2129db92df7.rlib" "D:\\Documents\\rust_manual\\target\\de
bug\\deps\\libgetrandom-60ce90fab31a9998.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libnotify-a3f8496c1768c614.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libwalkdir-01728b165c663904.rlib" "D:\\Documents\\ru
st_manual\\target\\debug\\deps\\libsame_file-bade0aa981bdf286.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libwinapi_util-aa42252baaa29f06.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibc-408386b57fa89aa8.r
lib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libfiletime-85a1a02ff2eb4f83.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libwinapi-fc941a2b370d489b.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libcfg_if
-cf58d0d3cd0e6fed.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libbitflags-288950b807dfd7f7.rlib" "D:\\Documents\\rust_manual\\target\\debug\\deps\\libbase64-e64b24a18f7239bc.rlib" "-Wl,--start-group" "D:\\Programs\\Rust\
\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-447f0e6919e87703.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\l
ib\\libpanic_unwind-6691a7d28fd5ead6.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-ee4714732ebaf9a3.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\
\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-e062de0dbb254b6a.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\
\lib\\libbacktrace-2bc81dc380687e4b.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libbacktrace_sys-53b5dac028b62d7c.rlib" "D:\\Programs\\Rust\\Rustup\\toolchai
ns\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-cb491f3ffc25ac52.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\li
bunwind-9499c77410f0cb84.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcfg_if-cb2a1962c04b6646.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-
pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-c582a1654a681be9.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-2285fe2f7f9a72ec.rlib
" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_core-1a51942af531248c.rlib" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-
gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-d7ecf429ccc8dc70.rlib" "-Wl,--end-group" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-4f
c9e886634acec6.rlib" "-Wl,-Bdynamic" "-lbcrypt" "-lcrypt32" "-luser32" "-lntdll" "-ladvapi32" "-lwinapi_advapi32" "-lwinapi_cfgmgr32" "-lwinapi_fwpuclnt" "-lwinapi_gdi32" "-lwinapi_kernel32" "-lwinapi_msimg32" "-lwinapi_ntdll" "-lwi
napi_opengl32" "-lwinapi_synchronization" "-lwinapi_user32" "-lwinapi_winspool" "-lwinapi_ws2_32" "-ladvapi32" "-lws2_32" "-luserenv" "-lmingwex" "-lmingw32" "-lmsvcrt" "-lmsvcrt" "-luser32" "-lkernel32" "-lgcc_eh" "-l:libpthread.a"
"-lgcc" "-lmsvcrt" "-lkernel32" "D:\\Programs\\Rust\\Rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
= note: /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(channel.o): in function `_libssh2_channel_free':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/channel.c:2723: undefined reference to `__assert_func'
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/channel.c:2723:(.text$_libssh2_channel_free+0x3a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__assert_func'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(sftp.o): in function `sftp_init':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:790: undefined reference to `__assert_func'
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:790:(.text$sftp_init+0x48): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__assert_func'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(sftp.o): in function `sftp_read':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:1459: undefined reference to `__assert_func'
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:1459:(.text$sftp_read+0x23a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__assert_fun
c'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:1460: undefined reference to `__assert
_func'
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:1460:(.text$sftp_read+0x26c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__assert_fun
c'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:1720: undefined reference to `__assert
_func'
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:1720:(.text$sftp_read+0x968): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__assert_fun
c'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(sftp.o):/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com
-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:2648: more undefined references to `__assert_func' follow
D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(sftp.o): in function `sftp_close_handle':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/sftp.c:2648:(.text$sftp_close_handle+0x305): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__as
sert_func'
D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(transport.o): in function `decrypt':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/transport.c:139:(.text$decrypt+0x63): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__assert_fu
nc'
D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(transport.o): in function `_libssh2_transport_read':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/transport.c:349:(.text$_libssh2_transport_read+0x13c): relocation truncated to fit: R_X86_64_PC32 against undefined sy
mbol `__assert_func'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(userauth.o): in function `memory_read_publickey':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/userauth.c:511: undefined reference to `__locale_ctype_ptr'
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/userauth.c:511:(.text$memory_read_publickey+0xaa): relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__locale_ctype_ptr'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: D:\\Documents\\rust_manual\\target\\debug\\deps\\liblibssh2_sys-b34136eee9b6d61b.rlib(userauth.o): in function `file_read_publickey':
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/userauth.c:613: undefined reference to `__locale_ctype_ptr'
/cygdrive/d/Programs/Rust/Cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.18/libssh2/src/userauth.c:613:(.text$file_read_publickey+0x1a5): relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__locale_ctype_ptr'
collect2: error: ld returned 1 exit status
error: aborting due to previous error; 80 warnings emitted
error: could not compile `rust_manual`.
Caused by:
process didn't exit successfully: `rustc --crate-name rust_manual --edition=2018 src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e02c4017dbb04ce1 -C
extra-filename=-e02c4017dbb04ce1 --out-dir D:\Documents\rust_manual\target\debug\deps -C linker=D:\Programs\Cygwin\bin\gcc.exe -C incremental=D:\Documents\rust_manual\target\debug\incremental -L dependency=D:\Documents\rust_manual\t
arget\debug\deps --extern aes_gcm=D:\Documents\rust_manual\target\debug\deps\libaes_gcm-46686bd39b60c02f.rlib --extern aes_gcm_siv=D:\Documents\rust_manual\target\debug\deps\libaes_gcm_siv-7f08f4ec229f0194.rlib --extern base64=D:\Do
cuments\rust_manual\target\debug\deps\libbase64-e64b24a18f7239bc.rlib --extern fs2=D:\Documents\rust_manual\target\debug\deps\libfs2-7cdf4dce3545590b.rlib --extern linked_hash_map=D:\Documents\rust_manual\target\debug\deps\liblinked
_hash_map-8ccaf07e1678ba81.rlib --extern notify=D:\Documents\rust_manual\target\debug\deps\libnotify-a3f8496c1768c614.rlib --extern rand=D:\Documents\rust_manual\target\debug\deps\librand-952ff6682f89685d.rlib --extern rand_core=D:\
Documents\rust_manual\target\debug\deps\librand_core-29c3a2129db92df7.rlib --extern serde=D:\Documents\rust_manual\target\debug\deps\libserde-4d09c2dcdbb1d8b3.rlib --extern serde_json=D:\Documents\rust_manual\target\debug\deps\libse
rde_json-53f81e6916eb8e26.rlib --extern ssh2=D:\Documents\rust_manual\target\debug\deps\libssh2-7df6425f87af870e.rlib -L native=D:\Programs\Rust\Cargo\registry\src\github.com-1ecc6299db9ec823\winapi-x86_64-pc-windows-gnu-0.4.0\lib -
L native=D:\Documents\rust_manual\target\debug\build\libssh2-sys-611fa0ef83ad9897\out\build -L native=D:\Documents\rust_manual\target\debug\build\libz-sys-0bd5febd50380866\out\build` (exit code: 1)
The output indicates to me that Rust is not linking the correct files. However, I have no idea how to solve this. I tried searching the web for similar problems, but couldn't find any that matched mine. If I missed something though, feel free to point me in the right direction.
Disclaimers:
The main goal of this question is to get debugging with JetBrains CLion working. Thus, alternative ways for achieving this outside my current attempts are also welcome.
I am new to Rust, and have limited knowledge of C/C++ compilers and linkers.

Related

Rust project failing to compile trying to link to libomp

After an update to the new macOS (Ventura 13.1, M1 Pro) version rust project started to crash on build when tries to link libomp. The error on cargo build -vv:
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-arch" "arm64" "/var/folders/_p/tgbl9k457tvbjbpxmb2q3r1m0000gn/T/rustc1sq6Z5/symbols.o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12.10102az2qpqlnssx.rcgu.o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12.10pmcgcmusc5twvn.rcgu.o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12.33ebzcr429zv4r69.rcgu.o" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/deps" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/ring-66285374768a0289/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/clickhouse-rs-cityhash-sys-56b125abd43a1bed/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/lz4-sys-b41f36414fcf3d57/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out/lib" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/bzip2-sys-55a2969129b4a854/out/lib" "-L" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librayon-a368ce40113bc0f7.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librayon_core-d9e15259c12109dd.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/lib{project_dir}-c76f044f35528d72.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtracing_loki-d0184819565b7bc6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsnap-306d8cec31a52cce.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtracing_serde-a73889d4392e2361.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libloki_api-ddd536117f3c02da.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libprost_types-572832ad507f9de0.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libprost-e068f62c28ccc8b2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liborder_stat-25a20551870d634c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpancakeswap-4e0d114d9a2a76be.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers-a219b92e6641dbe1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_middleware-d29117ee6c7944b4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_signers-8eaf51178d999ed1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libeth_keystore-b991f15c61299d1b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libaes-85ce4a53054918f3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libopaque_debug-69d537144a36dc89.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libscrypt-688fa31c4f28c63b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsalsa20-7fa37dfb872be400.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpassword_hash-ee6e3baff74b42c1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpbkdf2-3d9567eefa71c45a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libctr-f37779e2de156ab2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcipher-56165c31f9471ba2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcoins_bip39-4d851dd8aaf70dac.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpbkdf2-5bb0582222c9e070.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpassword_hash-e0ed827d8e9fd003.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase64ct-74280d3beea8da8e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbitvec-9423a5447ef68001.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libradium-a089b6a53f21f784.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcoins_bip32-3a1c2a5c010b854c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbs58-c0142c1f88c6f8b7.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcoins_core-245c3e946073f305.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblake2-e9ec6e9f373c1ef4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase64-908fea8ab5c201dd.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libripemd-07f318d495654f0c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase58check-5df8d10f35a6bee5.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsha2-d597d4e6775fc17f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libdigest-96df25a861e1e14c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libopaque_debug-c5a545cdb63802d6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfake_simd-66c05d9faa110044.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblock_buffer-ca3c152eaf8294ac.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgeneric_array-4658500995f0dba1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblock_padding-8c899def0159c457.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbyte_tools-04232adcec1f2ed9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase58-61c3db63dadefe01.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbech32-ecfa67b0df0f995e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_locks-a0acad40751b0c2c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_etherscan-cbcf7d4d7670ce82.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsemver-10e716672a01011f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_aux-fd3d015d0a4edb77.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_contract-85e3f04ebf35ee9e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_providers-573f02d8178a7edc.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_timer-fb57d40fad211b41.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtracing_futures-d170a033d12065b3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_addressbook-2a0b7a4a7e07b1d5.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_core-0019fb6c6704b519.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_xid-e7d1530a327bea76.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libstrum-0a5428bb6883f13c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libk256-35436dc2a3673601.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libecdsa-83480df40be69291.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librfc6979-fae22233353d569d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsignature-2767ee0e150ba21c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libelliptic_curve-82183223f196e8bf.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsec1-0ddd593266f18fbb.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpkcs8-1b692c412fa3ede8.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libspki-9fe5635ab5e0291b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libder-19631b5bae8ff186.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase16ct-45afe28af36516d3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgroup-4b637aed44be1a61.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libff-092feacb084533b4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrypto_bigint-4dceeffb77fde972.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libzeroize-6d1a20a9695545ca.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsyn-a0b333f36cf6933a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libquote-564fbbf32ce874a1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libproc_macro2-a12129456c79b3ae.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_ident-2df767b08b5dee4e.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libproc_macro-00b05ec0a97de84e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libconvert_case-7ad0534d8c5fd8c3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfastrlp-256bc78a1ef74915.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethabi-d8f8b392b37cd582.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethereum_types-0eb195605b40513c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethbloom-1e54de4eae147b61.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtiny_keccak-0cb69878e52df2f3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libprimitive_types-4f54843cfb523fba.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libimpl_codec-8e47d3c4d0d7172d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libparity_scale_codec-0d2e9771e57e0938.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbyte_slice_cast-7479fed5ff548fa4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libimpl_serde-6a5277220fa398c6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libimpl_rlp-da0374252df098bf.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librlp-240681309e2ba0a2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfixed_hash-964906ceb0260a33.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librustc_hex-22afa64d3d0ca991.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsha3-874e48672e2f596d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libkeccak-ad55d88ffa7ab68c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libuint-3a101f0d60a79d53.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrunchy-aa9525a478410cd6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libstatic_assertions-0ff83d9301a80122.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liberased_serde-c1e6cb738a619760.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbinance_{project_dir}-861a3e967128a5d3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libhmac_sha256-06695515fb30ad01.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtokio_native_tls-4c9f6996cf1ea42b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtokio-86cdf7ae56108f25.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsignal_hook_registry-1e2cd83343c3c9db.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnum_cpus-c7ce2c947fb8cdf4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsocket2-4352fe09b768a757.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libmio-290b15fdaef97a66.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libparking_lot-34cf09bf4119fbd2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libparking_lot_core-d1fa6b2701b27516.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsmallvec-25a503f6c5b2115b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblock_api-007f4f757f665560.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libscopeguard-e5de70d0869a1c62.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_util-b48bc9683ec1862f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libmemchr-6c9fbfeda127ffa9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_io-31c6c3fdbfd7acd1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libslab-875bd9101045b6dd.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_channel-20a3c3a00df83455.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpin_project_lite-ebcedf82ec43c8a1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_sink-03bac378879c749a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_task-ee914422cb186d20.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpin_utils-fe0d75987f40efa5.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_core-cf6b91f091126cd4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtungstenite-ca8867ea48f31ee9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase64-63d35bb8646f0242.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librand-90b2f68f9b08d326.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librand_chacha-b44402712ed3dace.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libppv_lite86-697eeaf5f72102e4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librand_core-de8033ba78482ef2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgetrandom-b3a5e67bd72e9479.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnative_tls-f4934c5623c8a8a9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtempfile-367f4cfc6447abfe.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfastrand-59e99e6b8d72a8ac.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libremove_dir_all-a13bce8a768cc08e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsecurity_framework-538b9df5ab088483.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbitflags-6db4b7a1a2354e6b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsecurity_framework_sys-eb98a88952287665.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcore_foundation-ec930b180bb57bc2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblazy_static-0773c577324b701d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libutf8-0c5e5daffc553b62.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbyteorder-faf1acd975834e27.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsha1-9f15f43c46c73cd0.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libdigest-5d770a9e9e6ea149.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsubtle-2e8596ffab1ab75f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libconst_oid-834c0e0b1604df37.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblock_buffer-4f4761ca28d48ae4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrypto_common-584dd06845a293e9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgeneric_array-dc3be67fb5b90830.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtypenum-2b09589daa71d801.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libhttparse-9d194949d06437af.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libthiserror-7ecb4a699b8920d3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liburl-936a0b47da399149.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libidna-b5faa9c2ece42de8.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_normalization-1c164c59614d379d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtinyvec-5417aa7aadc151a2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtinyvec_macros-7959d4d6443a0458.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_bidi-106b62c41d379400.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libform_urlencoded-49bcd040a7c16576.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpercent_encoding-477b6fb21f40da87.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblog-6ddcd53f5312ef38.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcfg_if-f043d77383bd547c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libhttp-cf4bb2360a1f828f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbytes-73183855b42e1e92.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfnv-a96d0f7e079db9b2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libchrono-08619b9cfb303392.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libiana_time_zone-8212bb41be21572b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcore_foundation_sys-9b0150f66877fcf2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnum_integer-bafe1031ea8e0662.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtime-08e3f249427e3b17.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblibc-fc26f4dd5713c66f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcapnp-51990ee9b5227c5a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtoml-fe00432fe23ba335.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_json-16a6e5424b301f9e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libryu-5b49562fe5a7a929.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libitoa-1a7b4806aa6816d6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librust_decimal-81a1e6b928a08798.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde-b10975cd22772c38.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libarrayvec-f160a33dcc17dc71.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnum_traits-f8699bb15f4e50a3.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-8b48f6cefff7b1fb.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-77aeaad8f850e496.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-4374cc9e76b48de5.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-71ce82846aaede9b.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-88478a43231eec41.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-219a0c42f67a2534.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-967edde4cff44b15.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-5e9bad2c7ec1f53a.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-f2d3de7828f2e1f2.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-39feb0179b2f197f.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-fe7523d51d4e2154.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-1fb439e2b08a54ae.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-0ece1873dc3050cd.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-1094a874bdfc7dbb.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-8cd76113b92d6775.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-3a7cb21921429c0e.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-5b42fb3902d391c7.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-b495777441600026.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-cba95c4386a21469.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-b8f163a13cf94b5d.rlib" "-lc++" "-lomp" "-framework" "CoreFoundation" "-framework" "SystemConfiguration" "-lc++" "-framework" "Security" "-framework" "Security" "-framework" "CoreFoundation" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12" "-Wl,-dead_strip" "-nodefaultlibs"
= note: ld: library not found for -lomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
warning: `{project}` (bin "{project}") generated 63 warnings
error: could not compile `{project}` due to previous error; 63 warnings emitted
Caused by:
process didn't exit successfully: `CARGO=/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_BIN_NAME={project} CARGO_CRATE_NAME={project} CARGO_MANIFEST_DIR=/Users/vikulikov/projects/{project_path} CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME={project} CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.10.7 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=10 CARGO_PKG_VERSION_PATCH=7 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 DYLD_FALLBACK_LIBRARY_PATH='/Users/vikulikov/projects/{project_path}/target/debug/deps:/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/vikulikov/lib:/usr/local/lib:/usr/lib' rustc --crate-name {project} --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=ec57ac4e6d4eed12 -C extra-filename=-ec57ac4e6d4eed12 --out-dir /Users/vikulikov/projects/{project_path}/target/debug/deps -C incremental=/Users/vikulikov/projects/{project_path}/target/debug/incremental -L dependency=/Users/vikulikov/projects/{project_path}/target/debug/deps --extern anyhow=/Users/vikulikov/projects/{project_path}/target/debug/deps/libanyhow-3c4562411ebdf4c7.rlib --extern chrono=/Users/vikulikov/projects/{project_path}/target/debug/deps/libchrono-08619b9cfb303392.rlib --extern crossbeam=/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrossbeam-fd8c6961f76e5aac.rlib --extern csv=/Users/vikulikov/projects/{project_path}/target/debug/deps/libcsv-1e27cf452055291a.rlib --extern itertools=/Users/vikulikov/projects/{project_path}/target/debug/deps/libitertools-b33196f4ae79cd67.rlib --extern {project_dir}=/Users/vikulikov/projects/{project_path}/target/debug/deps/lib{project_dir}-c76f044f35528d72.rlib --extern {project_dir}_core=/Users/vikulikov/projects/{project_path}/target/debug/deps/lib{project_dir}_core-ff32a9a09b2fee14.rlib --extern order_stat=/Users/vikulikov/projects/{project_path}/target/debug/deps/liborder_stat-25a20551870d634c.rlib --extern parking_lot=/Users/vikulikov/projects/{project_path}/target/debug/deps/libparking_lot-34cf09bf4119fbd2.rlib --extern rayon=/Users/vikulikov/projects/{project_path}/target/debug/deps/librayon-a368ce40113bc0f7.rlib --extern rust_decimal=/Users/vikulikov/projects/{project_path}/target/debug/deps/librust_decimal-81a1e6b928a08798.rlib --extern rust_decimal_macros=/Users/vikulikov/projects/{project_path}/target/debug/deps/librust_decimal_macros-67e08731edac8129.dylib --extern serde=/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde-b10975cd22772c38.rlib --extern serde_derive=/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_derive-60aad29f37dfad23.dylib --extern serde_json=/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_json-16a6e5424b301f9e.rlib --extern tokio=/Users/vikulikov/projects/{project_path}/target/debug/deps/libtokio-86cdf7ae56108f25.rlib --extern toml=/Users/vikulikov/projects/{project_path}/target/debug/deps/libtoml-fe00432fe23ba335.rlib -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/ring-66285374768a0289/out -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/clickhouse-rs-cityhash-sys-56b125abd43a1bed/out -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/lz4-sys-b41f36414fcf3d57/out -L /Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out/lib -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/bzip2-sys-55a2969129b4a854/out/lib` (exit status: 1)
It needs the lib due to lightgbm-rs lib used in the project. I believe I've already tried all the technics needed for lightgbm to compile from the internet, even reset the OS. Installed the llvm and gcc seperately, etc.
Actions after reset:
# rust installing
brew install cmake libomp lightgbm
brew link --force libomp
cargo build
Maybe it is good to mention that lightgbm and lightgbm-sys libs are successfuly built. And crash is happenning in the very end of the build.
Actually problem occured because homebrew made libomp keg-only.
They suggest to add couple of env variables for compilers to find the lib:
For compilers to find libomp you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
But cargo does not respect LDFLAGS variable. So I've tried to add a RUSTFLAGS variable as:
export RUSTFLAGS=-L/opt/homebrew/opt/libomp/lib
and it worked.

Error when compiling my fortran code. I believe that error is in cuba library, but i installed the library correctly

I am a beginning in programming and I need help in my code in Fortran. The error displayed when compiling is
joaovitor1729#joao:~/Fortran/centrol-foton$ make teste_intmult
gfortran -O3 -c -o teste_intmult.o teste_intmult.f90
cc -L/home/joaovitor1729/lib teste_intmult.o -o teste_intmult
/usr/bin/ld: teste_intmult.o: in function `MAIN__':
teste_intmult.f90:(.text+0x93): undefined reference to `cuhre_'
/usr/bin/ld: teste_intmult.f90:(.text+0xd3): undefined reference to `_gfortran_st_write'
/usr/bin/ld: teste_intmult.f90:(.text+0xe7): undefined reference to `_gfortran_transfer_character_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x14a): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x15a): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x1b8): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x211): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x221): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x229): undefined reference to `_gfortran_st_write_done'
/usr/bin/ld: teste_intmult.f90:(.text+0x2b1): undefined reference to `suave_'
/usr/bin/ld: teste_intmult.f90:(.text+0x2ec): undefined reference to `_gfortran_st_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x300): undefined reference to `_gfortran_transfer_character_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x35e): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x36e): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x3cc): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x427): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x437): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x43f): undefined reference to `_gfortran_st_write_done'
/usr/bin/ld: teste_intmult.o: in function `fx_':
teste_intmult.f90:(.text+0x4cd): undefined reference to `exp'
/usr/bin/ld: teste_intmult.o: in function `main':
teste_intmult.f90:(.text.startup+0x5): undefined reference to `_gfortran_set_args'
/usr/bin/ld: teste_intmult.f90:(.text.startup+0x16): undefined reference to `_gfortran_set_options'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: teste_intmult] Error 1
rm teste_intmult.o
This is my Makefile
...
F90C = gfortran
F90BANDEIRAS = -O3
LDFLAGS = -L${HOME}/lib
LIBS = -ldquadpack -lm
LIBM = -lcuba -lm
OBJC = defaults.o parcom.o
EXEC =
NCLVL = 15
.SUFIXOS: .f90 .f .o
.KEEP_STATE:
#####################################
teste_intmult: ${OBJC} teste_intmult.o ${F90C} -o run.teste_intmult ${F90FLAGS} ${OBJC} teste_intmult.o ${LDFLAGS} ${LIBS}
#####################################
%.o: %.f90 ${F90C} ${F90FLAGS} -c -o $# $<
#####################################
clean: -rm -vf run.* . ~ *~ *.o a.out *.mod genmod
veryclean: -rm -vf *.o .mod . ~ ~ .exe .sh.o a.out run . genmod . *.run ############### o fim ###############

error: could not compile `migrations_macros`

While running cargo build, I'm getting the following error:
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.0.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.1.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.10.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.11.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.12.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.13.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.14.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.15.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.2.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.3.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.4.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.5.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.6.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.7.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.8.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.migrations_macros.2g6ue3dg-cgu.9.rcgu.o" "-o" "/home/jarvis/SRC/grid/target/debug/deps/libmigrations_macros-24cc179ad0cdafd6.so" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.3xjhulvvd33umm2i.rcgu.o" "/home/jarvis/SRC/grid/target/debug/deps/migrations_macros-24cc179ad0cdafd6.479uqkygm96t55vg.rcgu.o" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/jarvis/SRC/grid/target/debug/deps" "-L" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/jarvis/SRC/grid/target/debug/deps/libsyn-3ee1b9a4d6995c1a.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libquote-849401de171008b7.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libproc_macro2-4431be3eb037870a.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libunicode_xid-373664510327a5cc.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-bba0624c33176ddd.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libmigrations_internals-7f9f79f1a7c23e47.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libdiesel-260ed13c59074541.rlib" "/home/jarvis/SRC/grid/target/debug/deps/liblibsqlite3_sys-de81366d49fa3d10.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libpq_sys-906759194dd6661c.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libserde_json-22c2837401b823a3.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libryu-c299d28f346c44ca.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libitoa-03464e37801631ae.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libserde-2784118073042576.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libr2d2-cf95ef9b2bd10f2c.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libscheduled_thread_pool-ad478afbdee29c90.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libparking_lot-873742aff8280e98.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libparking_lot_core-4da5ea6806b95c53.rlib" "/home/jarvis/SRC/grid/target/debug/deps/liblibc-1083c34519682e1b.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libsmallvec-e310e2c157142037.rlib" "/home/jarvis/SRC/grid/target/debug/deps/liblock_api-c5b0a39665108282.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libscopeguard-4eb98674ce111148.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libinstant-a66b52fcbf3b13e3.rlib" "/home/jarvis/SRC/grid/target/debug/deps/liblog-c34c04d5bf05faba.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libcfg_if-5027c5fda945db67.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libbyteorder-a6db7e07f13316c2.rlib" "/home/jarvis/SRC/grid/target/debug/deps/libbitflags-f14a0d5eed0a3c48.rlib" "-Wl,--start-group" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-6f77337c1826707d.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e238540f8faf9927.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-78f8506dd5004913.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-c0e64497deb085aa.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-217a514dc8d845c6.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-65e4f8df4b8bbd73.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-fec1b74170245419.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-e74f867eb2f15322.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-72a374d36f3d0a31.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-cb9206ed96de54c3.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-33ee81149d314805.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-2e8740599b11634b.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-241cf59851357bea.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-edc29aa8c04b480f.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-6a141406945fda5a.rlib" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-2408224b4af46d83.rlib" "-Wl,--end-group" "/home/jarvis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d36087076e1dd756.rlib" "-Wl,-Bdynamic" "-lsqlite3" "-lpq" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
= note: /usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: could not compile `migrations_macros`
Caused by:
process didn't exit successfully: `rustc --crate-name migrations_macros /home/jarvis/.cargo/registry/src/github.com-1ecc6299db9ec823/migrations_macros-1.4.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=24cc179ad0cdafd6 -C extra-filename=-24cc179ad0cdafd6 --out-dir /home/jarvis/SRC/grid/target/debug/deps -L dependency=/home/jarvis/SRC/grid/target/debug/deps --extern migrations_internals=/home/jarvis/SRC/grid/target/debug/deps/libmigrations_internals-7f9f79f1a7c23e47.rlib --extern proc_macro2=/home/jarvis/SRC/grid/target/debug/deps/libproc_macro2-4431be3eb037870a.rlib --extern quote=/home/jarvis/SRC/grid/target/debug/deps/libquote-849401de171008b7.rlib --extern syn=/home/jarvis/SRC/grid/target/debug/deps/libsyn-3ee1b9a4d6995c1a.rlib --extern proc_macro --cap-lints allow` (exit code: 1)
Does anyone know a fix to this?
I have tried all similar things by Googling them, none worked out.
Thanks.
I think your error originates from the fact that:
ld does not know about where your project libs are located. You have to place it into ld's known directories or specify the full path of your library by -L parameter to the linker.
Check this answer:
cpp: usr/bin/ld: cannot find -l<nameOfTheLibrary>

Error during "make all" in Caffe

I had an error after running the make all command while compiling Caffe. Here is what I got (it is a snippet):
CXX .build_release/src/caffe/proto/caffe.pb.cc
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
CXX/LD -o .build_release/tools/caffe.bin
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::~CodedInputStream()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::default_recursion_limit_'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::BytesUntilLimit() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::GoogleOnceInitImpl(int*, google::protobuf::Closure*)'
collect2: ld devolvió el estado de salida 1
make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1
make: *** Se espera a que terminen otras tareas....
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::~CodedInputStream()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::default_recursion_limit_'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::BytesUntilLimit() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::GoogleOnceInitImpl(int*, google::protobuf::Closure*)'
collect2: ld devolvió el estado de salida 1
make: *** [.build_release/tools/caffe.bin] Error 1
How can I fix this issue?
EDIT: I'm installing it in Ubuntu 12.04.
comment out line 113 in
/usr/local/cuda/include/host_config.h.
it is because gcc 5 error

Makefile - how to fix libc dependency?

I want to statically link Tk into my code. I am running into trouble due to dependencies. The modification I made to my Makefile is:
TK_LIBS_64 = \
-L/usr/X11R6/lib64 \
-lX11 \
-lXss \
-lXext \
-L/usr/X11R6/lib64 \
-lXft \
-lX11 \
-lfontconfig \
-lfreetype \
-lxmlparse \
-lexpat \
-L/usr/X11R6/lib64 \
-lXrender \
-lpthread \
-ldl \
-lpthread \
-lieee \
-lm
LIBS64 = \
-L$(TCL_ROOT)/lib/ -ltk8.5 \
$(TK_LIBS_64)
I get the following error on compilation:
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0x7f): In function `__pthread_initialize_minimal':
: undefined reference to `__libc_setup_tls'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0x86): In function `__pthread_initialize_minimal':
: undefined reference to `_dl_cpuclock_offset'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0xc0): In function `__pthread_initialize_minimal':
: undefined reference to `_errno'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0xcb): In function `__pthread_initialize_minimal':
: undefined reference to `_h_errno'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0x289): In function `pthread_initialize':
: undefined reference to `_res'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0x3cc): In function `pthread_initialize':
: undefined reference to `_dl_init_static_tls'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0x947): In function `__pthread_reset_main_thread':
: undefined reference to `_errno'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0x955): In function `__pthread_reset_main_thread':
: undefined reference to `_h_errno'
/usr/lib/../lib64/libpthread.a(pthread.o)(.text+0x963): In function `__pthread_reset_main_thread':
: undefined reference to `_res'
/usr/lib/../lib64/libpthread.a(ptw-write.o)(.text+0x1a): In function `write':
: undefined reference to `__syscall_error'
/usr/lib/../lib64/libpthread.a(ptw-write.o)(.text+0x72): In function `write':
: undefined reference to `__syscall_error'
/usr/lib/../lib64/libpthread.a(ptw-read.o)(.text+0x1a): In function `read':
: undefined reference to `__syscall_error'
/usr/lib/../lib64/libpthread.a(ptw-read.o)(.text+0x72): In function `read':
: undefined reference to `__syscall_error'
/usr/lib/../lib64/libpthread.a(ptw-close.o)(.text+0x1a): In function `close':
: undefined reference to `__syscall_error'
/usr/lib/../lib64/libpthread.a(ptw-close.o)(.text+0x5e): more undefined references to `__syscall_error' follow
/usr/lib/../lib64/libdl.a(dlopen.o)(.text+0x5): In function `dlopen':
: undefined reference to `__dlopen'
/usr/lib/../lib64/libdl.a(dlsym.o)(.text+0x5): In function `dlsym':
: undefined reference to `__dlsym'
/usr/lib/../lib64/libdl.a(dlerror.o)(.text+0x1): In function `dlerror':
: undefined reference to `__dlerror'
collect2: ld returned 1 exit status
*** Error code 1
dmake: Fatal error: Command failed for target
The undefined references are either in libc.a or libc_p.a and adding them to the dependencies does not help. Since the undefined references are system calls I think I am missing something basic here. I would be obliged if someone can point out the mistake.
use -pthread instead of -lpthread

Resources