【发布时间】:2020-11-25 22:03:05
【问题描述】:
我想知道是否有人以前见过这个错误,如果有,可以采取什么措施。
C:\workspace\myproj>iex -S mix phx.server
==> bcrypt_elixir
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
del /Q /F priv
erl -eval "io:format(\"~s~n\", [lists:concat([\"ERTS_INCLUDE_PATH=\", code:root_dir(), \"/erts-\", erlang:system_info(version), \"/include\"])])" -s init stop -noshell > Makefile.auto.win
nmake / /F Makefile.win priv\bcrypt_nif.dll
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
if NOT EXIST "priv" mkdir "priv"
cl /O2 /EHsc /I"c_src /std:c11" /I"c:/Program Files/erl10.7/erts-10.7/include" /LD /MD /Fepriv\bcrypt_nif.dll c_src\bcrypt_nif.c c_src\blowfish.c
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
bcrypt_nif.c
c_src\bcrypt_nif.c(94) : error C2275: 'ERL_NIF_TERM' : illegal use of this type as an expression
c:/Program Files/erl10.7/erts-10.7/include\erl_nif.h(100) : see declaration of 'ERL_NIF_TERM'
c_src\bcrypt_nif.c(94) : error C2146: syntax error : missing ';' before identifier 'output'
c_src\bcrypt_nif.c(94) : error C2065: 'output' : undeclared identifier
c_src\bcrypt_nif.c(95) : error C2143: syntax error : missing ';' before 'type'
c_src\bcrypt_nif.c(97) : error C2065: 'output_data' : undeclared identifier
c_src\bcrypt_nif.c(99) : error C2065: 'output' : undeclared identifier
c_src\bcrypt_nif.c(377) : error C2143: syntax error : missing ';' before 'volatile'
c_src\bcrypt_nif.c(379) : error C2065: 'ptr' : undeclared identifier
c_src\bcrypt_nif.c(379) : error C2100: illegal indirection
c_src\bcrypt_nif.c(379) : error C2106: '=' : left operand must be l-value
blowfish.c
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\nmake.EXE"' : return code '0x2'
Stop.
could not compile dependency :bcrypt_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile bcrypt_elixir", update it with "mix deps.update bcrypt_elixir" or clean it with "mix deps.clean bcrypt_elixir"
==> orcasite
** (Mix) Could not compile with "C:\Program Files (x86)\Microsoft Visual Studio 10.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.
我尝试在 bcrypt Makefile.in 中更改编译器的 C 版本,但结果相同。
环境:
操作系统:Windows 10 专业版
二郎:10.7
灵药:1.10.3
Microsoft C/C++ 优化编译器版本:16.00.30319.01 for x64
bcrypt_elixir:2.2.0
【问题讨论】:
标签: visual-c++ compiler-errors erlang elixir bcrypt