Daniel Guerrero Thoughts

Tuesday, November 08, 2005

Cheap Tip #1

Recently, I was testing wxnet and wxglade; I generated the CS code from a XRC resource through towxnet

The code compiled with no problems, but when I tried to execute it shows an error:

danguer@danguer:~/wxM$ mono app.exe

Unhandled Exception: System.DllNotFoundException: wx-c
in (wrapper managed-to-native) wx.App:wxApp_ctor ()
in <0x00012> wx.App:.ctor ()
in <0x0000a> MyApp:.ctor ()
in <0x00019> MyApp:Main (System.String[] args)


The readme only says that if this error shows, then you have to backtrack the error to one of the libraries which depends wx-c, easy to say, not easy to show =).
Also they show a command which can help you to debug how is loading (in Linux) the shared libraries: LD_DEBUG=files mono app.exe

Of course I use a lot strace for this; so I check the ENOENT, but of course it shows all the dirs where mono try to found the dll, so it's a bit hard to do it this way. I use the command the wxnet says; but like I've never used this I don't know what should appear. The answer is simple; prints the shared library which try to open, if is sucessful (it have found the library) prints something like:

4153: file=libwx-c.so [0]; needed by /usr/lib/libgmodule-2.0.so.0 [0]
4153: file=libwx-c.so [0]; generating link map
4153: dynamic: 0x40cf7f94 base: 0x40bb2000 size: 0x0014995c
4153: entry: 0x40c56cf0 phdr: 0x40bb2034 phnum: 4
4153:


It shows that the shared library was found and we could read it's data, when you don't have the shared library, it will show:

4153: file=libtiff.so.3 [0]; needed by /home/danguer/mono-1.1.9.2/lib/libwx_gtk2u_xrc-2.6.so.0 [0]
4153:


In this case, only prints the shared library, but not show anything more, because it haven't found the library, so I made a link (because I'm using libtiff4) to my libtiff library.

And this make the wxnet works fine under Linux

0 Comments:

Post a Comment

<< Home