我克隆了reactive-banana
并尝试构建reactive-banana-wx
示例:
git clone http://github.com/HeinrichApfelmus/reactive-banana.git
cd reactive-banana/reactive-banana-wx
stack build
该目录中有一个stack.yaml
,它确实获取了多个包,但会以以下错误停止:
Progress: 16/20
-- While building package wxc-0.92.2.0 using:
[snip]
Process exited with code: ExitFailure 1
Logs have been written to: /home/kostmo/github/reactive-banana/reactive-banana-wx/.stack-work/logs/wxc-0.92.2.0.log
[1 of 1] Compiling Main ( /tmp/stack5908/wxc-0.92.2.0/Setup.hs, /tmp/stack5908/wxc-0.92.2.0/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/Main.o )
Linking /tmp/stack5908/wxc-0.92.2.0/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup ...
Error: wx-config not found, please install wx-config before installing wxc
在运行stack build
之前,是否必须执行其他步骤?
该用户似乎有相关问题。
错误消息显示
Error: wx-config not found, please install wx-config before installing wxc
此错误表明您运行的程序找不到wx-config
实用程序,该实用程序是wxWidgets安装的一部分。一个可能的原因是您没有安装wxWidgets库,该库是用C++编写的。
@Heinrich的回答让我走上了正轨。
我按照这里的指示做了一些细微的改动。
在我的Ubuntu 15.10机器上,我执行了以下命令:
sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
# This seems to work even though my release's codename is "wily":
sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0.2/ubuntu/ utopic universe'
sudo apt-get update
sudo apt-get install g++ libglu-dev libwxgtk3.0-dev libwxbase3.0-0-unofficial libwxbase3.0-dev libwxgtk3.0-0-unofficial wx3.0-headers wx-common libwxgtk-media3.0-dev libwxgtk-webview3.0-dev
我不确定这些包中的每一个都是必要的,但在安装它们之后,我能够执行
stack build
成功地从reactive-banana/reactive-banana-wx
目录中删除。
我无法立即运行这些示例;我第一次从更改reactive-banana-wx.cabal
中flag buildExamples
下方的行
default: False
至
default: True
重新运行stack build
然后编译示例,可以按如下方式运行:
stack exec Counter