ruby - 在 Windows 中安装 zxing_cpp gem 时 cmake 抛出错误
问题描述
尝试使用以下命令在 Windows 中安装 zxing_cpp gem
gem install zxing_cpp
cmake 抱怨缺少一些环境变量(ICONV_LIBRARIES)。
环境:
Windows 10
ruby 2.5.7
zxing_cpp 0.1.1
cmake 3.20.5
这是 gem 构建的完整日志:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ICONV_LIBRARIES (ADVANCED)
C:\Users\viprasant>gem install zxing_cpp
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing zxing_cpp:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/zxing_cpp-0.1.1/ext/zxing
C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20210812-12952-1wi1uye.rb extconf.rb
CMake Deprecation Warning at CMakeLists.txt:6 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning at CMakeLists.txt:88 (message):
Not building testrunner, because CppUnit is missing
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ICONV_LIBRARIES (ADVANCED)
linked by target "libzxing" in directory C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/zxing_cpp-0.1.1/ext/zxing/zxing-cpp
CMake Generate step failed. Build files cannot be regenerated correctly.
make: *** No targets specified and no makefile found. Stop.
creating Makefile
current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/zxing_cpp-0.1.1/ext/zxing
make "DESTDIR=" clean
current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/zxing_cpp-0.1.1/ext/zxing
make "DESTDIR="
generating zxing-x64-mingw32.def
compiling zxing.cc
linking shared-object zxing/zxing.so
x86_64-w64-mingw32-g++.exe: error: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/zxing_cpp-0.1.1/ext/zxing/zxing-cpp/build/libzxing.a: No such file or directory
make: *** [Makefile:259: zxing.so] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/zxing_cpp-0.1.1 for inspection.
Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/zxing_cpp-0.1.1/gem_make.out
解决方案
推荐阅读
- python - 想从图像中检测模糊,但无法正确处理
- algorithm - 排队/等候名单位置计算器
- python - 无法按类别显示购物车数据库(Django)
- html - 基于 HTML 的混合内容表单 mailto
- python - BigQuery Python API copy_table 复制架构但不复制数据
- flutter - Flutter:通过强制手势竞技场获胜者修复同步融合日历滚动?
- snmp - #SNMP - GetBulk V2 请求限制为 100 个结果?
- laravel - Laravel 7 应用程序的缓存控制、过期和最后修改的标头没有以正确的状态码响应
- python - Textblob 推文:TypeError:传递给 `__init__(text)` 的 `text` 参数必须是字符串,而不是
, 行是列表 - windows - 无论如何,“ride.exe”有什么特别之处?