【问题标题】:How to install wxHaskell on Windows with MinGW/MSYS如何使用 MinGW/MSYS 在 Windows 上安装 wxHaskell
【发布时间】:2014-03-27 04:09:26
【问题描述】:

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

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 调用)也以某种方式拒绝识别它。如果我在 MSYS 中运行 wx-config,我会得到如下信息:

$ 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 fails to install on Haskell Platform 2012.2.0.0 (WinXP)。事实上,我找不到一个确认有效的答案。此外,这里的错误/设置似乎不同,或者其中的答案似乎无法解决我的问题。特别是,我从https://sourceforge.net/projects/wxhaskell/files/wx-config-win/ per http://www.haskell.org/haskellwiki/WxHaskell/Windows 下载了一个外部 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 &&

【问题讨论】:

  • 我将支持这个问题,并补充说让任何 GUI 东西安装在 Windows 上都太复杂了。
  • 我在这里概述了一种对我有用的方法:jpmoresmau.blogspot.fr/2010/04/…

标签: haskell wxwidgets wxhaskell


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-10
    • 2021-02-09
    • 1970-01-01
    • 1970-01-01
    • 2011-07-12
    • 1970-01-01
    • 1970-01-01
    • 2016-07-14
    相关资源
    最近更新 更多