migueltk's picture

error when moving the mouse cursor in Ubuntu

Project:The Open Toolkit library
Version:1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

All goes well until I move the mouse cursor and then closes the application showing the following error message. On Windows 7 (32 bit) works correctly. In the application hides the cursor using "CursorVisible = false", can have anything to do with the problem?

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.Input.Mouse ---> System.DllNotFoundException: libXi
at (wrapper managed-to-native) OpenTK.Platform.X11.Functions:XISelectEvents (intptr,intptr,OpenTK.Platform.X11.XIEventMask&,int)
at OpenTK.Platform.X11.Functions.XISelectEvents (IntPtr dpy, IntPtr win, XIEventMask mask) [0x00000] in :0
at OpenTK.Platform.X11.XI2Mouse..ctor () [0x00000] in :0
at OpenTK.Platform.X11.X11Factory.CreateMouseDriver () [0x00000] in :0
at OpenTK.Input.Mouse..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at OpenTK.Platform.X11.X11GLNative.ProcessEvents () [0x00000] in :0
at OpenTK.NativeWindow.ProcessEvents (Boolean retainEvents) [0x00000] in :0
at OpenTK.NativeWindow.ProcessEvents () [0x00000] in :0
at OpenTK.GameWindow.Run (Double updates_per_second, Double frames_per_second) [0x00000] in :0
at OpenTK.GameWindow.Run () [0x00000] in :0
at Bixion2D.Program.Main (System.String[] args) [0x00000] in :0
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 40 (X_TranslateCoords)
Resource id in failed request: 0x4a00002
Serial number of failed request: 1597
Current serial number in output stream: 1597

I use Ubuntu 10.10 (32 bit) and OpenTK from SVN

OpenGL version: 3.3.10237 Compatibility Profile Context
OpenGL renderer: ATI Radeon HD 3870


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

What is the output of:

locate libXi

?

On my Ubuntu 10.10 amd64 installation it reads:

/usr/lib/libXi.a
/usr/lib/libXi.so
/usr/lib/libXi.so.6
/usr/lib/libXi.so.6.1.0

OpenTK DllImports libXi.so.

(Edit: that said, the library should be able to fall back to core X if libXi is not available for some reason)

migueltk's picture

#2

locate output is

/usr/lib/libXi.so.6
/usr/lib/libXi.so.6.1.0
/usr/lib/libXinerama.so.1
/usr/lib/libXinerama.so.1.0.0

The problem is that I have no libXi.so library?

the Fiddler's picture

#3

You have the library (it's libXi.so.6.1.0) but the libXi.so symbolic link is missing. This is not the first time I encounter this issue on Ubuntu and I have no idea why the name is missing on x86, especially since it exists in the amd64 build.

I don't know what the correct solution is. You could edit OpenTK.dll.config to make it load libXi.so.6 instead of libXi.so, but that would break distributions that ship libXi.so.5 or other versions. I think your best bet would be to file a bug at https://launchpad.net/.

migueltk's picture

#4

Status:open» closed

The solution is to create a symbolic link "libXi.so" pointing at "libXi.so.6.1.0", I just checked. I do not understand why they have not created when installing Ubuntu.

Thanks for the help. Regards, ... Miguel

c2woody's picture

#5

Is this the official thing to do? Why is the link missing in the first place?

the Fiddler's picture

#6

No idea, which is why I suggested filing a bug report on launchpad.

c2woody's picture

#7

My reply was regarding migueltk's posting which suggested he may have found some information from the Ubuntu side that this is a known bug or known omission that has to be worked around. The latter case would be strange imo as the version-tagged library is present.