Take the 2-minute tour ×

I cannot get wxErlang to work at all. Do i need to include a module. Can't find any basic information relating to it. Please help. I am look for a very basic example of a module.

the error I am getting is

undefined function wx:start/0

share|improve this question
it seems that wx:start with 0 parameters doesn't exists... maybe it takes some parameter. –  fortran Aug 28 '09 at 19:26

3 Answers 3

This should display an empty frame:

1> wx:new().

2> Frame = wxFrame:new(wx:null(), 0, "myFrame").

3> wxFrame:show(Frame).
share|improve this answer
OK I am getting "bad function wx:new()." i am guessing I am missing a library. How do I go about solving that? –  Damian Aug 28 '09 at 19:45
Are you using R13? Did you compile with wx support? I think the library dependencies are: freeglut3-dev and libwxgtk2.8-dev –  Zed Aug 28 '09 at 19:49
You must also enable SMP support for wx. –  Zed Aug 28 '09 at 19:56
unfortunatly atm i am on a windows box. I have just searched through the erl/lib directory and did not find wxerlang. I have now downloaded the latest release of erlang and seems that I now have the wxerlang lib. I have another problem now, but I will look into it before posting another question. –  Damian Aug 28 '09 at 20:02
I have plucked the following code from some tutorial but I think it must be very old could you confirm this and point me in the right direction if possible. -module(test). -export([start/0]). start() -> wx:start(), XRC = wx:xml_resource_get(), wx:init_all_handlers(XRC), wx:load(XRC, "gui.xrc"), Frame = wx:load_frame(XRC, ?NULL, "frame_1"), wx:show(Frame). –  Damian Aug 28 '09 at 20:11

To find the ex-erlang-samples You should issue the following call in EShell to locate the base directory for wx-erlang:


On Windows the returned path uses "/" instead of "\", so just replace them.

Inside that directory there shoud be a directory "examples". Start with "simple" inside those examples.

Also You should check if wx is working properly: use


in EShell.

share|improve this answer
up vote -1 down vote accepted

I just needed to include the wx lib using the following line


include/ is a sub directory in my project containing the wx library.

share|improve this answer
Note: It should be: -include_lib("wx/include/wx.hrl"). Right? –  Mazen Harake Sep 11 '09 at 11:54
I am on a windows box and have setup my application on a different drive. I added and include directory and placed the wx files in that, so it works in my situation. –  Damian Sep 16 '09 at 19:01

Your Answer


