我做了一个培训项目,需要几个模块导入(Database.Redis和Web.Scotty )。当我做stack build时,我得到了这个:
D:\ssd-data\work\my-project\my-project.cabal was modified manually. Ignoring D:\ssd-data\work\my-project\package.yaml in favor of the cabal file.
If you want to use the package.yaml file instead of the cabal file,
then please delete the cabal file.
Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
WARNING: Ignoring regex-posix's bounds on base (<0 && >=4.3 && <4.14); using base-4.13.0.0.
Reason: trusting snapshot over cabal file dependency information.
regex-posix > configure
regex-posix > Configuring regex-posix-0.96.0.0...
regex-posix > build
regex-posix > Preprocessing library for regex-posix-0.96.0.0..
regex-posix > C:\Users\user\AppData\Local\Temp\stack3628\regex-posix-0.96.0.0\Wrap.hsc:96:10: fatal error: regex.h: No such file or directory
regex-posix > compilation terminated.
regex-posix > compiling .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.c failed (exit code 1)
regex-posix > command was: C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\../mingw/bin\gcc.exe -c .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.c -o .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.o -D__GLASGOW_HASKELL__=808 -Dmingw32_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dmingw32_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Icbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\cbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\autogen -I.stack-work\dist\29cc6475\build\global-autogen -include .stack-work\dist\29cc6475\build\autogen\cabal_macros.h -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\bytestring-0.10.10.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\base-4.13.0.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\integer-gmp-1.0.2.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib/include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3/lib/include/
streaming-commons> configure
streaming-commons> Configuring streaming-commons-0.2.1.2...
streaming-commons> build
streaming-commons> Preprocessing library for streaming-commons-0.2.1.2..
streaming-commons> Building library for streaming-commons-0.2.1.2..
streaming-commons> [ 1 of 17] Compiling Data.Streaming.ByteString.Builder.Buffer
streaming-commons> [ 2 of 17] Compiling Data.Streaming.ByteString.Builder
streaming-commons> [ 3 of 17] Compiling Data.Streaming.Filesystem
streaming-commons> [ 4 of 17] Compiling Data.Streaming.Network.Internal
streaming-commons> [ 5 of 17] Compiling Data.Streaming.Network
streaming-commons> [ 6 of 17] Compiling Data.Streaming.Process.Internal
streaming-commons> [ 7 of 17] Compiling Data.Streaming.Process
streaming-commons> [ 8 of 17] Compiling Data.Streaming.Zlib.Lowlevel
streaming-commons> [ 9 of 17] Compiling Data.Streaming.Zlib
streaming-commons> [10 of 17] Compiling Data.Text.Internal.Encoding.Utf16
streaming-commons> [11 of 17] Compiling Data.Text.Internal.Encoding.Utf32
streaming-commons> [12 of 17] Compiling Data.Text.Internal.Unsafe.Shift
streaming-commons> [13 of 17] Compiling Data.Text.Internal.Unsafe.Char
streaming-commons> [14 of 17] Compiling Data.Text.Internal.Encoding.Utf8
streaming-commons> [15 of 17] Compiling Data.Streaming.Text
streaming-commons> [16 of 17] Compiling System.Win32File
streaming-commons> [17 of 17] Compiling Data.Streaming.FileRead
streaming-commons> copy/register
streaming-commons> Installing library in C:\sr\snapshots\260bc685\lib\x86_64-windows-ghc-8.8.3\streaming-commons-0.2.1.2-7nSvofLzcDVEO2jjCYKFuK
streaming-commons> Registering library for streaming-commons-0.2.1.2..
-- While building package regex-posix-0.96.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.3.exe --builddir=.stack-work\dist\29cc6475 build --ghc-options ""
Process exited with code: ExitFailure 1
Progress 2/9当我构建一个没有任何导入的项目时,一切都没问题。
发布于 2021-01-02 13:25:04
我也有同样的问题,但我解决了。如果你还没有解决这个问题,我想如果你按照我做的去做,你就能解决这个问题。
错误消息的最重要部分如下所示。关键是头文件丢失(regex.h),您必须将它添加到正确的路径中。
regex-posix > ...\regex-posix-0.96.0.0\Wrap.hsc:96:10: fatal error:
regex.h: No such file or directory
regex-posix > compilation terminated.
...
regex-posix > command was: C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\../mingw/bin\gcc.exe -c .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.c -o .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.o -D__GLASGOW_HASKELL__=808 -Dmingw32_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dmingw32_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Icbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\cbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\autogen -I.stack-work\dist\29cc6475\build\global-autogen -include .stack-work\dist\29cc6475\build\autogen\cabal_macros.h -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\bytestring-0.10.10.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\base-4.13.0.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\integer-gmp-1.0.2.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib/include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3/lib/include/您可以从regex.h文件中获取https://code.woboq.org/linux/include/regex.h.html。将文件保存到路径中,如上面的错误消息(最后一行)所示。在您的例子中,路径是:
\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\include重要的是将regex.h文件放在Haskell的库文件夹中。(...\x86_64-windows\ghc-8.8.3\lib\include)之后,执行堆栈构建命令。
我希望我的回答对你有帮助。
https://stackoverflow.com/questions/60911650
复制相似问题