5

我试图将 wxHaskell 安装到运行 Windows XP64 的机器中,并使用 gcc 从源代码构建 MinGW/MSYS 和 wxWidget 3.0。我做了:

cabal install wx

并得到一个错误:

...
Configuring wxc-0.90.0.4...
setup.exe: wx-config: does not exist
Failed to install wxc-0.90.0.4
cabal.exe: Error: some packages failed to install:
wx-0.90.0.1 depends on wxc-0.90.0.4 which failed to install.
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.90.0.3 depends on wxc-0.90.0.4 which failed to install.

我已经成功地使用 wxWidgets 用 C++ (gcc) 编写了一个示例应用程序。所以我确实有一个工作的 wxWidget 安装。我有wx-config

$ which wx-config
/usr/local/bin/wx-config

问题是这wx-config是一个 unix shell 脚本,并且 cabal(从 MSYS 调用)以某种方式拒绝识别它,即使它在系统路径上也是如此。如果我wx-config在 MSYS 中运行,我会得到如下信息:

$ wx-config --cxxflags
-I/usr/local/lib/wx/include/msw-unicode-3.0 -I/usr/local/include/wx-3.0 -D_LARGE
FILE_SOURCE=unknown -DWXUSINGDLL -D__WXMSW__ -mthreads

我问了一个问题https://stackoverflow.com/questions/21998763/how-to-convert-msys-shell-scripts-to-windows-exe-files看看是否可以将脚本转换为 exe,但是没有人回应任何解决方案。

这里还有一个相关的问题,wxHaskell installation on windows,还有一个wx 0.90.0.1 failed to install on Haskell Platform 2012.2.0.0 (WinXP)。事实上,我找不到一个确认有效的答案。此外,这里的错误/设置似乎不同,或者其中的答案似乎无法解决我的问题。特别是,我根据http://www.haskell.org/haskellwiki/WxHaskell/Windows从https://sourceforge.net/projects/wxhaskell/files/wx-config-win/下载了一个外部 wx-config.exe 。但是运行 wx-config.exe 无法识别我的 wxWidget 安装,并且总是给我一个找不到 wxWidgets 的错误,如下所示:

$ ./wx-config.exe --prefix=/usr/local/
wx-config Error: wxWidgets hasn't been found installed at 'C:\MinGW\msys\1.0\loc
al'.

Please use the --prefix flag (as in wx-config --prefix=C:\wxWidgets)
or set the environment variable WXWIN (as in WXWIN=C:\wxWidgets)
to specify where is your installation of wxWidgets.

知道如何解决这个问题吗?

谢谢,

- 更新 -

@JP 我试过了:

C:\temp\wxdirect-0.90.0.1>runhaskell Setup configure --extra-lib-dirs=c:\MinGW\lib --extra-include-dirs=c:\MinGW\include --extra-include-dirs=c:\MinGW\msys\1.0\local\include
Configuring wxdirect-0.90.0.1...

并得到

Setup: At least the following dependencies are missing:
containers >=0.2 && <0.5, strict -any

我调整 wxdirect.cabal 以绕过容器 >=0.2 && <0.5,但无法通过严格。

4

1 回答 1

2

我编写了一个 powershell 脚本,它可以自动设置 MinGW 和下载/构建 wxWidgets,以便为 Windows 7 构建 wxHaskell。

https://github.com/cessationoftime/wxHaskell-Windows-Builder

于 2014-11-30T05:35:48.823 回答