You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows10下用MinGW/MSYS2编译MongoDB驱动时缺失依赖库问题

Rust MongoDB项目编译失败:缺失ADX指令相关ring依赖库

编译环境:Windows 10,使用MSYS2提供的gcc/x86_64-w64-mingw32/14.2.0工具链

编译失败原因:依赖包需要引用ring_core_0_17_8_fiat_curve25519_adx_mul和ring_core_0_17_8_fiat_curve25519_adx_square两个库,但编译时无法找到这两个库。


相关代码文件

task_process.rs

mod queues_mongo;

use queues_mongo::email_queue::search_queue;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let _ = search_queue().await;

  Ok(())
}

email_queue.rs

extern crate dotenv;

use dotenv::dotenv;
use std::env;

use mongodb::{
 bson::{doc, Document},
 error, Client, Collection, Database,
};

#[allow(dead_code)]
pub async fn search_queue() -> error::Result<()> {
 dotenv().ok();

 let uri: String = env::var("MONGO_URI").expect("MONGO_URI");
 let db: String = env::var("MONGO_DATABASE").expect("MONGO_DATABASE");

 let client: Client = Client::with_uri_str(uri).await?;
 let database: Database = client.database(db.as_str());
 let collection: Collection = database.collection("emails");
 let email: Option = collection.find_one(doc! { "status": "Sent" }).await?;

 println!("Found a email:\n{:#?}", email);

 Ok(())
}

Cargo.toml

[package]
name = "rustlang-course"
version = "0.1.0"
edition = "2021"

[dependencies]
aead = "0.5.2"
axum = "0.8.1"
base64 = "0.22.1"
bson = "2.13.0"
chrono = "0.4.39"
colored = "2.1.0"
csv = "1.3.1"
dotenv = "0.15.0"
futures = "0.3.31"
hex = "0.4.3"
mongodb = "3.1.1"
notify = "7.0.0"
notify-debouncer-full = "0.4.0"
notify-debouncer-mini = "0.5.0"
openssl = "0.10.68"
prost = "0.13.3"
rand = "0.8.5"
regex = "1.11.1"
reqwest = { version = "0.12.9", features = ["json"] }
roxmltree = "0.20.0"
serde = "1.0.214"
serde_json = "1.0.133"
sqlx = "0.8.2"
tokio = { version = "1.41.0", features = ["full"] }
tonic = "0.12.3"
uuid = "1.11.0"

[build-dependencies]
cc = "1.2.7"
tonic-build = "0.12.3"

[[bin]]
name = "task_process"
path = "src/task_process.rs"

补充说明

完整编译错误信息包含上述两个库未找到的链接错误。

内容的提问来源于stack exchange,提问作者apetitflores

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 03:26:17