混合编译过程的程序路径

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了混合编译过程的程序路径相关的知识,希望对你有一定的参考价值。

从Brew转换为Elixir和Erlang的asdf版本控制工具后,我仍然无法编译我的旧项目:在编译过程中,它试图引用不存在的Brew的Cellar lib文件:

MacBook-Pro% mix test
==> gettext
Compiling 1 file (.erl)
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:59: illegal pattern
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:60: variable 'Error' is unbound
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:60: variable 'Stacktrace' is unbound
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:63: variable 'Stacktrace' unsafe in 'try' (line 60)
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:64: variable 'Error' unsafe in 'try' (line 60)
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:64: variable 'Stacktrace' unsafe in 'try' (line 60)
could not compile dependency :gettext, "mix compile" failed. You can recompile this dependency with "mix deps.compile gettext", update it with "mix deps.update gettext" or clean it with "mix deps.clean gettext"

即使没有任何/usr/local/Cellar/erlang文件夹

mix在哪里获取外部erlang库的路径以及如何更改它以使用asdf的bundle?

答案

Erlang和Elixir使用$PATH环境变量中的二进制文件和库,如下所述:https://elixir-lang.org/install.html#installing-erlang

asdf通常在$PATH的末尾加载,这意味着如果你仍然通过brew安装了Erlang和Elixir,它将首先加载。也就是说,请仔细检查是否通过brew安装了任何其他Erlang版本。您可以使用命令brew uninstall erlang --force卸载所有版本

还可以使用以下命令在项目的根目录中设置本地Erlang和Elixir版本:

asdf local erlang 21.3.2
asdf local elixir 1.8.1-otp-21

根据您的环境更改版本。

最后使用命令asdf current检查asdf是否正在加载正确的版本。它应该显示如下:

elixir         1.8.1-otp-21 (set by /path/to/project/.tool-versions)
erlang         21.3.2   (set by /path/to/project/.tool-versions)

作为最后的手段,请查看https://asdf-vm.com/#/core-manage-asdf-vm?id=having-issues

以上是关于混合编译过程的程序路径的主要内容,如果未能解决你的问题,请参考以下文章

错误记录Flutter 混合开发获取 BinaryMessenger 报错 ( FlutterActivityAndFragmentDelegate.getFlutterEngine() )(代码片段

Flutter + Android 混合开发

导致资产预编译在heroku部署上失败的代码片段

Android 逆向Android 逆向通用工具开发 ( Android 平台运行的 cmd 程序类型 | Android 平台运行的 cmd 程序编译选项 | 编译 cmd 可执行程序 )(代码片段

请教一个qt与Matlab混合编程的问题

在 nvidia opengl 上混合 glGetTexImage 和 imageStore 的问题