我一直在尝试在我的 Macbook M1 上运行 Rust Diesel crate,但它不起作用。编译的最后部分因以下错误而中断:
\n = note: ld: warning: ignoring file /usr/local/Cellar/libpq/14.1/lib/libpq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64\n Undefined symbols for architecture arm64:\nRun Code Online (Sandbox Code Playgroud)\n当我得到信息时,libpq我得到以下信息:
maxwellflitton@Maxwells-MacBook-Pro vanguard % brew info libpq \nlibpq: stable 14.1 (bottled) [keg-only]\nPostgres C API library\nhttps://www.postgresql.org/docs/14/libpq.html\n/usr/local/Cellar/libpq/14.1 (2,335 files, 27.8MB)\n Poured from bottle on 2022-01-09 at 00:14:32\nFrom: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libpq.rb\nLicense: PostgreSQL\n==> Dependencies\nRequired: krb5 \xe2\x9c\x94, openssl@1.1 \xe2\x9c\x94\n==> Caveats\nlibpq is keg-only, which means it was not symlinked into /usr/local,\nbecause conflicts …Run Code Online (Sandbox Code Playgroud) 好吧,这里有点无处可去。在我发布了我的 Mac M1 与 Rust Diesel 的链接器问题并没有得到任何结果之前。因此,我启动了一个 Ec2 实例,并尝试在此处运行此包,并得到以下结果:
error: linking with `cc` failed: exit status: 1
...
= note: /usr/bin/ld: cannot find -lpq
Run Code Online (Sandbox Code Playgroud)
我已经安装了以下内容:
sudo yum update -y
sudo yum install git -y
sudo yum groupinstall "Development Tools" -y
sudo yum install cmake -y
sudo yum install postgresql-libs -y
Run Code Online (Sandbox Code Playgroud)
说真的,人们是如何设法让这个箱子运行的?