Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linux - How to link with SDL2 SO file?
Forum Updated to NodeBB v4.3 + New Features

Linux - How to link with SDL2 SO file?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 399 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stretchthebits
    wrote on last edited by
    #1

    I followed the steps at
    https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

    to link to OpenGL, libpng, libjpeg, but I am unable to link to SDL2 since the file does not end with .SO

    The file name in the case of SDL2 is
    /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0

    and the add file dialog filter has *lib, *.a, *.so

    1 Reply Last reply
    0
    • hskoglundH Online
      hskoglundH Online
      hskoglund
      wrote on last edited by
      #2

      You can edit the qmake .pro file manually, .e.g add a line like this:
      LIBS += /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0

      jsulmJ 1 Reply Last reply
      0
      • hskoglundH hskoglund

        You can edit the qmake .pro file manually, .e.g add a line like this:
        LIBS += /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @hskoglund said in Linux - How to link with SDL2 SO file?:

        LIBS += /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0

        Should be
        LIBS += -L/usr/lib/x86_64-linux-gnu -lSDL2-2.0
        on Linux.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • S Offline
          S Offline
          stretchthebits
          wrote on last edited by
          #4

          Actually, it looks like it wants
          LIBS += -lSDL2

          and so, the above compiled and runs.

          1 Reply Last reply
          1
          • S stretchthebits has marked this topic as solved on

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved