1

我已经尝试了看似无穷无尽的方法来stack build引用图书馆secp256k1-haskell,但无济于事。

这是我的.cabal文件-

cabal-version:       >=1.10
name:                testproj
version:             0.1.0.0
license:             BSD3
license-file:        LICENSE
author:              XXXX
maintainer:          XXXX@gmail.com
build-type:          Simple
extra-source-files:  CHANGELOG.md

library
  exposed-modules:     Addr
  build-depends:       base
                     , secp256k1-haskell
  hs-source-dirs:      src
  default-language:    Haskell2010

我在 Windows 环境中,并设法libsecp256k1.dll.netNuget 包中获取了一个版本。我尝试将以下行添加到我的.cabal文件中也无济于事 -

  extra-lib-dirs:      lib
  extra-libraries:     libsecp256k1

希望得到一些帮助。谢谢 - 我今晚花了很多时间试图让它发挥作用。

这是构建输出 -

# stack build
secp256k1-haskell> configure
secp256k1-haskell> Configuring secp256k1-haskell-0.5.0...
secp256k1-haskell> Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.4.exe: The pkg-config package
secp256k1-haskell> 'libsecp256k1' is required but it could not be found.
secp256k1-haskell>
Progress 1/2

--  While building package secp256k1-haskell-0.5.0 (scroll up to its section to see the error) using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.4.exe --builddir=.stack-work\dist\274b403a configure --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\cae65304\pkgdb --libdir=C:\sr\snapshots\cae65304\lib --bindir=C:\sr\snapshots\cae65304\bin --datadir=C:\sr\snapshots\cae65304\share --libexecdir=C:\sr\snapshots\cae65304\libexec --sysconfdir=C:\sr\snapshots\cae65304\etc --docdir=C:\sr\snapshots\cae65304\doc\secp256k1-haskell-0.5.0 --htmldir=C:\sr\snapshots\cae65304\doc\secp256k1-haskell-0.5.0 --haddockdir=C:\sr\snapshots\cae65304\doc\secp256k1-haskell-0.5.0 --dependency=QuickCheck=QuickCheck-2.14.2-88oxj61ONgG1QbYzt1cUFu --dependency=base=base-4.14.1.0 --dependency=base16-bytestring=base16-bytestring-0.1.1.7-ATNpmQnyL4kEoV4zknoOaT --dependency=bytestring=bytestring-0.10.12.0 --dependency=cereal=cereal-0.5.8.1-22Ay1xouyZe6jvGIwilboJ --dependency=deepseq=deepseq-1.4.4.0 --dependency=entropy=entropy-0.4.1.6-7IAXxZCKwXr4yX0UquKkIf --dependency=hashable=hashable-1.3.0.0-K3FFBNAmsvaIvBv4Qg15rQ --dependency=string-conversions=string-conversions-0.4.0.1-8DWCo9Xs3pABRiarhAOqbn --dependency=unliftio-core=unliftio-core-0.2.0.1-9GVcmaajsglG88oErAZOTV --extra-include-dirs=C:\Users\difel\AppData\Local\Programs\stack\x86_64-windows\msys2-20200903\mingw64\include --extra-lib-dirs=C:\Users\difel\AppData\Local\Programs\stack\x86_64-windows\msys2-20200903\mingw64\lib --extra-lib-dirs=C:\Users\difel\AppData\Local\Programs\stack\x86_64-windows\msys2-20200903\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
    Process exited with code: ExitFailure 1
4

1 回答 1

1

不是很修复——但我最终选择简单地安装并从那里进行开发libsecp256k1WSL2发现该环境比尝试在 Windows 上进行开发更加用户友好且易于设置。

于 2021-05-31T21:17:19.800 回答