1

I cloned reactive-banana and tried to build the reactive-banana-wx example:

git clone http://github.com/HeinrichApfelmus/reactive-banana.git 
cd reactive-banana/reactive-banana-wx
stack build

There is a stack.yaml in that directory, and it does fetch several packages, but stops with this error:

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

Is there some other step that must be performed before running stack build?

This user seemed to have a related problem.

Community
  • 1
  • 1
kostmo
  • 6,222
  • 4
  • 40
  • 51

2 Answers2

1

The error message says

Error: wx-config not found, please install wx-config before installing wxc

This error suggests that the program you ran cannot find the wx-config utility, which is part of the wxWidgets installation. One possible reason is that you don't have the wxWidgets library installed, which is written in C++.

Heinrich Apfelmus
  • 11,034
  • 1
  • 39
  • 67
1

@Heinrich's answer put me on the right track.

I followed the directions here with some slight alterations.

On my Ubuntu 15.10 machine, I executed these commands:

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

I'm not sure of every one of those packages was necessary, but after installing them I was able to execute

stack build

successfully from within the reactive-banana/reactive-banana-wx directory.

I was not immediately able to run the examples; I first changed the line in reactive-banana-wx.cabal just under flag buildExamples from

default:     False

to

default:     True

Re-running stack build then compiled the examples, which could be run as follows:

stack exec Counter
kostmo
  • 6,222
  • 4
  • 40
  • 51