尝试编译argon2_elixir时nmake失败
我正试图将尝试编译argon2_elixir时nmake失败,elixir,dependency-management,nmake,elixir-mix,Elixir,Dependency Management,Nmake,Elixir Mix,我正试图将argon2_elixir添加到我的phoenix项目中,但在编译时出现以下错误: mix compile ==> argon2_elixir Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. makefile(34) : fatal error U1000: syntax erro
argon2_elixir
添加到我的phoenix项目中,但在编译时出现以下错误:
mix compile
==> argon2_elixir
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
makefile(34) : fatal error U1000: syntax error : ')' missing in macro invocation
Stop.
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
==> chatter
** (Mix) Could not compile with "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" (exit status: 2).
One option is to install a recent version of
[Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)
either manually or using [Chocolatey](https://chocolatey.org/) -
`choco install VisualCppBuildTools`.
After installing Visual C++ Build Tools, look in the "Program Files (x86)"
directory and search for "Microsoft Visual Studio". Note down the full path
of the folder with the highest version number. Open the "run" command and
type in the following command (make sure that the path and version number
are correct):
cmd /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
This should open up a command prompt with the necessary environment variables
set, and from which you will be able to run the "mix compile", "mix deps.compile",
and "mix test" commands.
在此错误之前,它之前提到了如何找不到nmake.exe
,并将其设置为MAKE
系统变量。因此,我进入环境变量并将路径设置为C:\ProgramFiles(x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe
如果我用以下命令打开cmd/powershellcmd/K“C:\…”amd64
我必须cd
回到phoenix项目中。运行mix compile
/mix deps.compile argon2_elixir
后,它会给出相同的错误
我注意到有一个问题,但没有解决办法
这是我的mix.ex文件
defmodule Chatter.MixProject do
使用Mix.Project
def项目do
[
应用程序::chatter,
版本:“0.1.0”,
长生不老药:“~>1.5”,
elixirc_路径:elixirc_路径(Mix.env()),
编译器:[:phoenix,:gettext]++Mix.compilers(),
start_permanent:Mix.env()==:prod,
别名:别名(),
deps:deps()
]
结束
#OTP应用程序的配置。
#
#有关详细信息,请键入“mix help compile.app”。
def应用程序do
[
mod:{Chatter.Application,[]},
额外的应用程序:[:logger,:runtime_tools,:phoenix,:phoenix_pubsub,:phoenix_html,:cowboy,:logger,:gettext,
:菲尼克斯·埃克托,:波斯格雷克斯,:科莫宁]
]
结束
#指定每个环境要编译的路径。
defp elixirc_路径(:test),do:[“lib”,“test/support”]
defp elixirc_路径(u),do:[“lib”]
#指定项目依赖项。
#
#键入'mix help deps'以获取示例和选项。
defp deps do
[
{:凤凰城,“~>1.4.1”},
{:phoenix_pubsub,“~>1.1”},
{:phoenix_-eto,“~>4.0”},
{:exto_sql,“~>3.0”},
{:postgrex,“>=0.0.0”},
{:phoenix_html,“~>2.11”},
{:phoenix\u live\u reload,“~>1.2”,仅::dev},
{:gettext,“~>0.11”},
{:jason,“~>1.0”},
{:plug_cowboy,“~>2.0”},
{:comeonin,“~>5.1.1”},
{:argon2_长生不老药,“~>2.0”}
]
结束
#别名是特定于当前项目的快捷方式或任务。
#例如,要立即创建、迁移和运行种子文件,请执行以下操作:
#
#$mix EXTO.setup
#
#有关别名的更多信息,请参阅“Mix”文档。
defp别名可以吗
[
“异位设置”:[“异位创建”、“异位迁移”、“运行priv/repo/seeds.exs”],
“异位复位”:[“异位复位”、“异位复位”],
测试:[“exto.create--quiet”、“exto.migrate”、“test”]
]
结束
结束
您在Makefile
的第34行遇到错误。它应该在Windows上使用Makefile.win
而不是Makefile
,但在这种情况下它不会
原来这是elixir\u make
的一个“功能”。如果要使用的make可执行文件是nmake
,它将使用参数/F Makefile.win
,否则它不会指定要使用哪个Makefile,并且nmake
可能会返回到使用Makefile
。这种情况经常发生
但是,由于您将MAKE
环境变量设置为C:\Program Files(x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe
,因此这不再等同于nmake
,因此使用Makefile
而不是Makefile.win
,您会得到一个错误
我建议两件事:
- 将
更改为包含PATH
nmake.exe所在的目录,而不是设置
环境变量MAKE
- 。它可能应该检查由
指定的可执行文件是否具有文件名MAKE
或nmake
,而不是简单地与字符串nmake.exe
进行比较“nmake”
makefile
的第34行找到了一个错误-但是argon2_elixir也有。我想问题是,有些东西选择运行Makefile
而不是Makefile.win
。我想指出的是,任何遇到Makefile.win
的人,其原因是,目录中要么有一个Makefile
,如果是这样,只需创建另一个名为Makefile.win
的文件,其中没有任何实际的env
if语句,否则会出错。它将自动完成编译。。。英雄联盟