[erlang-questions] WX Failed loading "wxe_driver"

128 views
Skip to first unread message

micern

unread,
Aug 6, 2012, 2:36:28 PM8/6/12
to erlang-q...@erlang.org
Hello!

I'm trying to learn Erlang, so I apologize if this is a trivial problem I
should have solved myself.

I'm failing when using WX, trying to open a window for my application.

Yep, Windows 7 seams to be an odd choice of OS, but that is what I've got.

Doing this in the monitor fails:
--------------------------------
1> Wx = wx:new().

=ERROR REPORT==== 6-Aug-2012::19:42:42 ===
WX Failed loading "wxe_driver"@"c:/PROGRA~1/ERL59~1.1/lib/wx-0.99.2/priv"
** exception error: {load_driver,"Det går inte att hitta den angivna
modulen."}
in function wxe_server:start/0 (wxe_server.erl, line 64)
in call from wx:new/1 (wx.erl, line 107)

2> Wx.
* 1: variable 'Wx' is unbound


The corresponding code in an .erl file fails too:
-----------------------------------------------
-module(minimal).

-include_lib("wx/include/wx.hrl").

-export([start/0]).
-compile(export_all).

start() ->
Wx = wx:new(),
Frame = wx:batch(fun() -> create_window(Wx) end),
wxWindow:show(Frame),
loop(Frame),
wx:destroy(),
ok.

(more code, loop, create_window, etc).

...

7> c(minimal).
{ok,minimal}
8> minimal:start().

=ERROR REPORT==== 6-Aug-2012::19:49:23 ===
WX Failed loading "wxe_driver"@"c:/PROGRA~1/ERL59~1.1/lib/wx-0.99.2/priv"
** exception error: {load_driver,"Det går inte att hitta den angivna
modulen."}
in function wxe_server:start/0 (wxe_server.erl, line 64)
in call from wx:new/1 (wx.erl, line 107)
in call from minimal:start/0 (minimal.erl, line 16)

yep, it bombs @ Wx = wx:new(), ...


Starting the debugger get a similar warning, even if the window actually
opens.
------------------------------------------------
2> debugger:start().

=ERROR REPORT==== 6-Aug-2012::19:47:08 ===
WX Failed loading "wxe_driver"@"c:/PROGRA~1/ERL59~1.1/lib/wx-0.99.2/priv"
{ok,<0.40.0>}


Digging in Erlang library files on my computer...
-------------------------------------------------
Directory .../erl5.9.1/lib/wx-0.99.2 exists.
wxe_driver@c:/PROGRA~1/ERL59~1.1/lib/wx-0.99.2/priv exists.


Swedish...
----------
"Det går inte att hitta den angivna modulen" = "Not possible to find the
module"


WHY?!?!?! AND WHAT TO DO?!?!?!

/micael

--
View this message in context: http://erlang.2086793.n4.nabble.com/WX-Failed-loading-wxe-driver-tp4655138.html
Sent from the Erlang Questions mailing list archive at Nabble.com.
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Steve Davis

unread,
Aug 6, 2012, 7:22:14 PM8/6/12
to erlang-pr...@googlegroups.com, erlang-q...@erlang.org, micael....@gmail.com
Pretty sure this a crazy "Program Files" path thing. Windows still isn't too smart.

Your easiest bet is to reinstall erlang in a path without spaces in the name. When I was on windows I would choose to install to e.g.:
"C:\Erlang-R15B02"

...rather than into "C:\Program Files\...".

I ran multiple versions like this and I strongly suspect that the space in the path is the issue for the failed driver load (yes, even though it says "PROGRA~1").

HTH
/s

micern

unread,
Aug 7, 2012, 4:16:39 PM8/7/12
to erlang-q...@erlang.org

Hi again!

I was recommended to reinstall Erlang using a shorter path name, to avoid
path names with a blank, as in 'Program Files'.

I reinstalled Erlang to c:\Erlang and edited the Path variable to include
c:\Erlang\bin and
c:\Erlang\lib (I assume ...\lib should be there too).

The wxw_driver do exist in c:/Erlang/lib/wx-0.99.2/priv.

But it fails as before. See the error reports below.

Any other ideas?

/micael


starting the debugger
---------------------

3> debugger:start().

=ERROR REPORT==== 7-Aug-2012::21:35:40 ===
WX Failed loading "wxe_driver"@"c:/Erlang/lib/wx-0.99.2/priv"
{ok,<0.37.0>}


Wx
--
4> Wx = wx:new().

=ERROR REPORT==== 7-Aug-2012::21:42:40 ===
WX Failed loading "wxe_driver"@"c:/Erlang/lib/wx-0.99.2/priv"

** exception error: {load_driver,"Det går inte att hitta den angivna
modulen."}
in function wxe_server:start/0 (wxe_server.erl, line 64)
in call from wx:new/1 (wx.erl, line 107)


--
View this message in context: http://erlang.2086793.n4.nabble.com/WX-Failed-loading-wxe-driver-tp4655138p4655139.html

Dave Cottlehuber

unread,
Aug 7, 2012, 5:08:30 PM8/7/12
to erlang-q...@erlang.org
On 7 August 2012 22:16, micern <micael....@gmail.com> wrote:
>
>
> Hi again!
>
> I was recommended to reinstall Erlang using a shorter path name, to avoid
> path names with a blank, as in 'Program Files'.
>
> I reinstalled Erlang to c:\Erlang and edited the Path variable to include
> c:\Erlang\bin and
> c:\Erlang\lib (I assume ...\lib should be there too).
>
> The wxw_driver do exist in c:/Erlang/lib/wx-0.99.2/priv.
>
> But it fails as before. See the error reports below.
>
> Any other ideas?
>
> /micael

Could be you have 8.3 filenames disabled for 'performance reasons'. It
fits the initial case, but I'm not sure it would explain the 2nd
c:\Erlang\ scenario.

Does "pushd c:\PROGRA~1\ERL59~1.1\lib\wx-0.99.2\priv" work for you?

The other option is that you're missing some MSVC runtime dependency
for the DLL. Check with depends.exe (you'll need to google/download
it) but its self explanatory really. IIRC this error can also occur.

My final next step would be to run procexp from sysinternals.com and
get a list of all activities referring to wx in filepath. This will
likely clarify where erlang is searching and failing to find the DLL.

A+
Dave

dmitry kolesnikov

unread,
Aug 8, 2012, 12:08:33 AM8/8/12
to micern, erlang-q...@erlang.org
Most likely you have an issue with dependencies. Could you check what
libraries are imported by driver and validate that system has
corresponding ones?

Best Regards,
Dmitry >-|-|-*>
Reply all
Reply to author
Forward
0 new messages