Skip to content

mac 下编译的问题 #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
erasin opened this issue May 19, 2021 · 3 comments
Closed

mac 下编译的问题 #16

erasin opened this issue May 19, 2021 · 3 comments

Comments

@erasin
Copy link
Contributor

erasin commented May 19, 2021

直接编译hello的时候报错

 Compiling hello v0.0.0 (/Users/...../workspace/phper/examples/hello)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "-L" "/Users/.........-lc" "-lm" "-liconv"
  = note: Undefined symbols for architecture x86_64:
....

然后给项目追加了文件下 .cargo/config.toml 文件

[build]

[target.x86_64-apple-darwin]
rustflags = ["-Clink-args=-Wl,-undefined,dynamic_lookup"]

编译和测试可以走通

rust-lang/rust#62874

@jmjoy
Copy link
Member

jmjoy commented May 19, 2021

帮忙提交一下pr呗

@erasin
Copy link
Contributor Author

erasin commented May 20, 2021

我新建了个测试项目发现引用的phper后,项目本身在mac环境下也是需要追加 .cargo/config 编译配置,linux平台下则不需要配置. 所以建议在文档中说明.

@jmjoy
Copy link
Member

jmjoy commented May 21, 2021

我手上没有macos的机器,我开了个pr,你看看? #17

@erasin erasin closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants