程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了不能`cabal install doctest`大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决不能`cabal install doctest`?

开发过程中遇到不能`cabal install doctest`的问题如何解决?下面主要结合日常开发的经验,给出你关于不能`cabal install doctest`的解决方法建议,希望对你解决不能`cabal install doctest`有所启发或帮助;

我在尝试安装 cabal 软件包 doctest(以及其他一些软件包)时遇到构建错误。

我使用 Intel x86-64 芯片在 11.1 版上运行 MacOS。

如果有人能帮助我找出此构建失败的原因,我将不胜感激。我无法在 Internet 上找到有关此错误的任何信息。非常矛盾的警告说 building for macOS-x86_64 but attempTing to link with file built for macOS-x86_64 使我最困惑。

完整的构建日志如下:

[Zack:...oMP1130/labs/comp1100-lab03]$ cabal v2-install doctest
Resolving dependencIEs...
Build profile: -w ghc-8.6.5 -O1
In order,the following will be built (use -v for more details):
 - doctest-0.18.1 (exe:doctest) (requires build)
StarTing     doctest-0.18.1 (exe:doctest)
Building     doctest-0.18.1 (exe:doctest)

Failed to build exe:doctest from doctest-0.18.1.
Build log ( /Users/Zack/.cabal/logs/ghc-8.6.5/dctst-0.18.1-044b1b17.log ):
Configuring executable 'doctest' for doctest-0.18.1..
Warning: The package has an extraneous version range for a dependency on an
internal library: doctest >=0 && ==0.18.1,doctest >=0 && ==0.18.1. This
version range includes the current package but isn't needed as the current
package's library will always be used.
Preprocessing executable 'doctest' for doctest-0.18.1..
Building executable 'doctest' for doctest-0.18.1..
[1 of 2] Compiling Main             ( driver/Main.hs,dist/build/doctest/doctest-tmp/Main.o )
[2 of 2] Compiling Paths_doctest    ( dist/build/doctest/autogen/Paths_doctest.hs,dist/build/doctest/doctest-tmp/Paths_doctest.o )
linking dist/build/doctest/doctest ...
ld: warning: ignoring file /Users/Zack/.cabal/store/ghc-8.6.5/syb-0.7.2.1-8996991c/lib/libHSsyb-0.7.2.1-8996991c.a,building for macOS-x86_64 but attempTing to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/Zack/.cabal/store/ghc-8.6.5/ghc-pths-0.1.0.12-5d9fa1db/lib/libHSghc-pths-0.1.0.12-5d9fa1db.a,building for macOS-x86_64 but attempTing to link with file built for unkNown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file /Users/Zack/.cabal/store/ghc-8.6.5/dctst-0.18.1-d578345b/lib/libHSdctst-0.18.1-d578345b.a,building for macOS-x86_64 but attempTing to link with file built for unkNown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file /Users/Zack/.cabal/store/ghc-8.6.5/xcptns-0.10.4-3ecc6514/lib/libHSxcptns-0.10.4-3ecc6514.a,building for macOS-x86_64 but attempTing to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/Zack/.cabal/store/ghc-8.6.5/cd-pg-0.2.1-e0f661a5/lib/libHScd-pg-0.2.1-e0f661a5.a,building for macOS-x86_64 but attempTing to link with file built for unkNown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file /Users/Zack/.cabal/store/ghc-8.6.5/bs-cmpt-0.11.2-742fbb99/lib/libHSbs-cmpt-0.11.2-742fbb99.a,building for macOS-x86_64 but attempTing to link with file built for unkNown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
  "_dctstzm0zi18zi1zmd578345b_Run_doctest1_closure",referenced from:
      _udje_srt in Main.o
  "_dctstzm0zi18zi1zmd578345b_Run_doctest1_info",referenced from:
      _cdjy_info in Main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command Failed with exit code 1 (use -v to see invocation)
`gcc' Failed in phase `linker'. (Exit code: 1)
cabal: Failed to build exe:doctest from doctest-0.18.1. See the build log
above for details.

我尝试重新安装 XCode 命令行工具,并验证 $(which ranlib) -V 具有以下输出:

Apple Inc. version cctools-977.1
error: /library/Developer/Commandlinetools/usr/bin/ranlib: no archives specifIEd
Usage: /library/Developer/Commandlinetools/usr/bin/ranlib [-sactfqLT] [-] archive [...]

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的不能`cabal install doctest`全部内容,希望文章能够帮你解决不能`cabal install doctest`所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:install