作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
运行cargo build
时,出现以下错误:
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)
有人知道解决办法吗?
最佳答案
我认为您的错误源于以下事实:
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.
关于bash - 错误: could not compile `migrations_macros` ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66435424/
运行cargo build时,出现以下错误: error: linking with `cc` failed: exit code: 1 | = note: "cc" "-Wl,--as-ne
我是一名优秀的程序员,十分优秀!