Results 1 to 2 of 2

Thread: [SDL] undefined reference to `SDL_GetKeyState'

  1. #1

    [SDL] undefined reference to `SDL_GetKeyState'

    Hey,

    I'm trying to compile my engine on linux, but I get the following error:

    /n3d/workingdir/src/n3d_input.pas:687: undefined reference to `SDL_GetKeyState'
    meshtestproj.lpr(241,1) Error: Error while linking
    I guess there is a problem with my SDL library. It's staticly linked, so that makes perfect sense.

    Any idea's how to fix this?

    Thanks
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    Re: [SDL] undefined reference to `SDL_GetKeyState'

    Ok, I got a big clue.

    I used:

    locate SDL.so

    /home/*username*/dev/SDL1.3/sdl/build/.libs/libSDL.so
    /usr/local/lib/libSDL.so
    To find the library file.

    Then I checked both libraries with the following command:

    nm -D /usr/local/lib/libSDL.so | grep SDL_GetK

    000358e0 T SDL_GetKeyFromScancode
    00036260 T SDL_GetKeyName
    0000ae10 T SDL_GetKeyRepeat
    00035810 T SDL_GetKeyboardState
    According to the SDL docs, sdl 1.2 (which I am using now) has SDL_GetKeyState() while 1.3 has SDL_GetKeyboardState. So both files are SDL1.3.

    So I need the *.so for SDL1.2. I don't want to get rid of my 1.3 library because it was quite a struggle (for me as a beginner) to set it up.

    Can anyone tell me what I need to do to make sure SDL1.2 is linked to my project-code instead of 1.3, without destroying the 1.3 installation?

    Thanks.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •