-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Linux, SDL_bgi 2.6.0] Error while linking: undefined reference to 'xkbhit' #1
Comments
rchastain
changed the title
[Linux, SDL_bgi-2.6.0] Error while linking: undefined reference to 'xkbhit'
[Linux, SDL_bgi 2.6.0] Error while linking: undefined reference to 'xkbhit'
Jan 31, 2023
After I installed SDL_bgi 3.0.0. With the original ubgi unit, I get the error I don't know why my patch doesn't work with that version of the library. |
Solution for SDL_bgi 3.0.0: (*
Returns 1 when a key is pressed, excluding special keys
(Ctrl, Shift, etc.); in 'slow mode', a screen refresh is performed.
If an SDL_QUIT event occurs, QUIT is returned.
*)
function KbHit(): Integer;
cdecl; external LIB_UBGI name LIB_FNPFX + 'k_bhit';//'kbhit';
(*
Returns 1 when any key is pressed, including special keys
(Ctrl, Shift, etc.) in 'slow mode', a screen refresh is performed.
If an SDL QUIT event occurs, QUIT is returned.
*)
function XKbHit(): Integer;
cdecl; external LIB_UBGI name LIB_FNPFX + 'xkb_hit';//'xkbhit';
{ ... }
function KeyPressed(): Boolean;
begin
//{$IFDEF LINUX}
// Result := XKbHit() <> 0;
//{$ELSE}
Result := KbHit() <> 0;
//{$ENDIF}
end; |
For 2.6.0, the solution was: function KbHit(): Integer;
cdecl; external LIB_UBGI name LIB_FNPFX + 'bgi_kbhit';//'kbhit';
{ ... }
function KeyPressed(): Boolean;
begin
//{$IFDEF LINUX}
// Result := XKbHit() <> 0;
//{$ELSE}
Result := KbHit() <> 0;
//{$ENDIF}
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! Congratulations for this very nice project.
I installed on Linux SDL_bgi 2.6.0. When I try to compile an example from ubgi, I get this error:
After taking a look into ubgi.pas, I tried this.
With that modification, I can compile the example. (But I understood later that it wasn't the correct solution. See correct solution below.)
The text was updated successfully, but these errors were encountered: