【问题标题】:Cannot compile exqlite on Windows无法在 Windows 上编译 exqlite
【发布时间】:2021-11-08 09:36:37
【问题描述】:

背景

我正在尝试在我的 Windows VM 中运行这个 Elixir 桌面应用程序: https://github.com/elixir-desktop/desktop-example-app

我已经在我的 Windows 中手动安装了 Erlang OTP 24.X: https://erlang.org/download/otp_win64_24.1.4.exe

之后我通过官网安装了 Elixir,并将其配置为使用我之前提到的 Erlang/OTP 版本: https://elixir-lang.org/install.html#windows

问题

所以,我克隆了项目并照常运行mix deps.get。 之后我跑了mix deps.compile,我得到了一个错误:

λ mix deps.compile
===> Analyzing applications...
===> Compiling dbus
===> Analyzing applications...
===> Compiling ranch
===> Analyzing applications...
===> Compiling telemetry
==> exqlite
could not compile dependency :exqlite, "mix compile" failed. You can recompile this dependency with "mix deps.compile exqlite", update it with "mix deps.update exqlite" or clean it with "mix deps.clean exqlite"
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.

这意味着我遇到了依赖问题:

λ mix deps.compile exqlite
==> exqlite
could not compile dependency :exqlite, "mix compile" failed. You can recompile this dependency with "mix deps.compile exqlite", update it with "mix deps.update exqlite" or clean it with "mix deps.clean exqlite"
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.

我尝试了什么

所以,我猜我在 windows 上的 sqlite 安装做得不好。我已经按照本教程在 Windows 中安装了 sqlite:

https://www.tutorialspoint.com/sqlite/sqlite_installation.htm

归结为:

  1. 转到SQLite download page,从 Windows 部分下载预编译的二进制文件。
  2. 下载sqlite-shell-win32-*.zipsqlite-dll-win32-*.zip 压缩文件。
  3. - 创建一个文件夹C:\>sqlite 并在此文件夹中解压上面的两个压缩文件,这将为您提供sqlite3.defsqlite3.dllsqlite3.exe 文件。
  4. - 在PATH环境变量中添加C:\>sqlite,最后进入命令提示符并发出sqlite3命令,应该可以了。

事实上,当我在提示符中输入sqlite3 时,它确实有效。

但是我知道我仍然缺少一些步骤,但我不知道是什么。

问题

我在编译依赖项时缺少什么?

【问题讨论】:

    标签: sqlite elixir


    【解决方案1】:

    原来我的问题是因为exqlite 使用了 NIF。这意味着我需要为 Windows 做一个额外的设置步骤,我在其中安装 cpp 工具,然后使用此提示编译 exqlite

    • cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"

    完整的指南可以在这里看到: https://hexdocs.pm/exqlite/windows.html

    官方论坛的更多信息:

    【讨论】:

      猜你喜欢
      • 2011-12-27
      • 1970-01-01
      • 1970-01-01
      • 2020-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多