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. How to include SDL lib
Forum Updated to NodeBB v4.3 + New Features

How to include SDL lib

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.7k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    Germ
    wrote on last edited by
    #1

    Hi, Qt community.
    I have some truble with icluding SDL lib in Qt 5.2.1.
    Anybody do it?
    In *.pro i write:
    @
    INCLUDEPATH += C:/SDL-1.2.15/include/SDL
    LIBS += C:/SDL-1.2.15/lib -lSDL

    HEADERS +=
    test.h

    SOURCES +=
    test.cpp

    QT += core gui
    @
    And when i compile it, I have three errors:
    @
    :-1: error: cannot find C:/SDL-1.2.15/lib: Permission denied
    :-1: error: cannot find -lSDL
    collect2.exe:-1: error: error: ld returned 1 exit status
    @
    What does it means?
    Community help me pleas.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You are missing a -L before C:/SDL-1.2.15/lib

      So it should be

      @LIBS += -LC:/SDL-1.2.15/lib -lSDL@

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Germ
        wrote on last edited by
        #3

        Oh thanks, I don't know about it!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Germ
          wrote on last edited by
          #4

          Thats great!
          I write my projekt, hi is compilet, but don't started.
          I think it is a problem with SDL lib, I del all my projekt and write simple program.
          @
          #include <stdio.h>
          #include <conio.h>
          #include <stdlib.h>

          int main()
          {
          int a,b;
          printf("vvedite a\n");
          scanf("%d\n",&a);
          printf("vvedite b\n");
          scanf("%d\n",&b);
          printf("%d\n",a+b);
          }
          @

          then I build it.
          But when I started I have an error 0cx0000139.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            It means you are missing one or several dlls which I suspect are those from SDL. Go to the Project panel -> run and update the PATH variable adding the path to your SDL dlls. Then you should be good to go

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

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