Game Development Community

Quick fix for 'X11_KeyToUnicode' build errors

by Christopher \"Pacula\" Corkum · in Torque Game Builder · 11/15/2006 (5:48 am) · 1 replies

There's been a couple reports of TGB not building due to 'undefined symbol: X11_KeyToUnicode' errors during the link process. While I have no doubt that I'm not the first to figure out this problem, I thought I'd post what I found about the issue and a simple fix for it.

From what I've gathered, X11_KeyToUnicode is an internal utility function in SDL that was apparently not meant to be externally usable, and never part of the SDL spec. For some reason however (bug? feature?) it was made public, and used by a number of programs. Recent versions of SDL have this bug fixed, and the function hidden, to the detriment of any program that had used it.

Fortunately, fixing this problem is almost trivial - X11_KeyToUnicode is only used in one place in TGB, and an earlier version of the code that doesn't use this function was left in the source code, merely disabled. Dig down to engine/source/platformX86UNIX in the source tree, and open up x86UNIXInputManager.cc. Scroll down a bit, and you'll see a MapKey() function. Comment out the currently active code there, and remove the #if 0/#endif pair disabling the old version of the code below it, and the X11_KeyToUnicode errors should no longer be an issue.

#1
12/05/2006 (3:54 am)
Cheers, that sorted my problem :)=

EDIT: Well, it compiled at least..just no input anymore :(