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

SDL.h

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 2.0k 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.
  • TechnologistT Offline
    TechnologistT Offline
    Technologist
    wrote on last edited by
    #1

    I'm getting a "C:\Temp\untitled1\untitled2\main.cpp:2: error: SDL/SDL.h: No such file or directory" error for a hello SDL app. Can anyone help? I did fine with eclipse, but I want to get it going with Qt.

    .pro

    TEMPLATE = app
    CONFIG += console c++11
    CONFIG -= app_bundle
    CONFIG -= qt
    
    SOURCES += main.cpp
    INCLUDEPATH += C:/Software/SDL/INCLUDE/
         LIBS += -LC:/Software/SDL/lib -lmingw32 -mwindows -mconsole -lSDL2main -lSDL2
         CXXFLAGS = -std=c++11
    ``
    main.cpp
    

    #include <iostream>
    #include <SDL/SDL.h>

    int main(int argc, char *argv[])
    {
    SDL_Init(SDL_INIT_EVERYTHING);
    std::cout << "HELLO World!" << std::endl;
    return 0;
    }

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

      Hi,

      What exactly do you have in C:/Software/SDL/INCLUDE/ ?

      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
      • TechnologistT Offline
        TechnologistT Offline
        Technologist
        wrote on last edited by
        #3

        excellent ques:

        ![include directory](![https://ibb.co/jrTrBF]())
        
        TechnologistT 1 Reply Last reply
        0
        • TechnologistT Technologist

          excellent ques:

          ![include directory](![https://ibb.co/jrTrBF]())
          
          TechnologistT Offline
          TechnologistT Offline
          Technologist
          wrote on last edited by Technologist
          #4

          @Technologist

          "click link" to include directory photo

          <a href="https://ibb.co/jrTrBF"><img src="https://preview.ibb.co/h3RNJv/ans_qt.png" alt="ans_qt" border="0"></a><br />

          1 Reply Last reply
          0
          • TechnologistT Offline
            TechnologistT Offline
            Technologist
            wrote on last edited by
            #5

            Now building but not running.
            I've changed the include line to just <SDL.h> and it compiles. However its crashing on run. Is this a DLL issue?

            #include <iostream>
            #include <SDL.h>

            int main(int argc, char *argv[])
            {
            SDL_Init(SDL_INIT_EVERYTHING);
            std::cout << "HELLO World!" << std::endl;
            return 0;
            }

            1 Reply Last reply
            0
            • TechnologistT Offline
              TechnologistT Offline
              Technologist
              wrote on last edited by Technologist
              #6

              Ok, I copied what was apparently a missing dll SDL2.dll to the release folder of my project and the crashing was stopped.

              Hurray

              I had to hunt these folders down (release/debug). I know in Eclipse the release and debug folders are obvious in the hierarchical project/file tree easily visible. Is it possible to have Qt creator tree do this? I've tried various options but haven't had any luck. In other words, can the tree be set to in clude release and debug?

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

                The more simple way for that is to add the path to the SDL .dlls to that PATH environment variable for the run time environment of your application.

                You can find that in the Run part of the Project panel. Do not modify the variable from your system.

                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
                1

                • Login

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