Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rust Diesel无法编译,出现链接器错误_Rust_Rust Cargo_Rust Diesel - Fatal编程技术网

Rust Diesel无法编译,出现链接器错误

Rust Diesel无法编译,出现链接器错误,rust,rust-cargo,rust-diesel,Rust,Rust Cargo,Rust Diesel,我使用的是Diesel,它使用的是以下Cargo.toml配置: diesel={version=1.4.4,features=[postgres]} 在没有柴油的情况下运行,一切正常。当我引入上述依赖项时,它无法编译,出现以下错误: clang:错误:链接器命令失败,退出代码为1使用-v查看调用 OS:MacOS大苏尔 更新 我已使用以下命令安装了libpq: brew install libpq brew link --force libpq 然后,我尝试将其与以下命令链接: brew

我使用的是Diesel,它使用的是以下Cargo.toml配置:

diesel={version=1.4.4,features=[postgres]} 在没有柴油的情况下运行,一切正常。当我引入上述依赖项时,它无法编译,出现以下错误:

clang:错误:链接器命令失败,退出代码为1使用-v查看调用 OS:MacOS大苏尔

更新 我已使用以下命令安装了libpq:

brew install libpq
brew link --force libpq
然后,我尝试将其与以下命令链接:

brew install libpq
brew link --force libpq

这起作用了。感谢为我指出这一方向的评论。

您需要在系统上正确安装postgres:

//ubuntu $sudo apt安装libpq dev //osx $brew安装libpq
您需要在系统上正确安装postgres:

//ubuntu $sudo apt安装libpq dev //osx $brew安装libpq
这是完整的错误消息吗?你安装了postgres吗?@IbraheemAhmed谢谢你,因为我的安装没有链接,这就解决了问题。我已经更新了这个问题。将您的评论作为答案,我可以选择它作为解决方案。这是完整的错误消息吗?您是否安装了postgres?@IbraheemAhmed感谢您出于某种原因取消了我的安装链接,从而解决了问题。我已经更新了这个问题。把你的评论作为答案,我可以选择它作为解决方案