Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Console application falls if I start it from Creator, but works when i just open .exe

Console application falls if I start it from Creator, but works when i just open .exe

Scheduled Pinned Locked Moved Solved 3rd Party Software
7 Posts 2 Posters 1.1k Views 2 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.
  • B Offline
    B Offline
    BrMisha
    wrote on last edited by
    #1

    Hi!
    I built some small console application using SFML lib, but it falls when i run it from creator (I see only "Press <RETURN> to close this window..."), but it works if i'm starting .exe file.
    I added "c:\SFML\bin" to PATH.
    pro file:

    QT -= gui
    
    CONFIG += c++11 console
    CONFIG -= app_bundle
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += \
            main.cpp #UDP.cpp
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    LIBS += -LC:/SFML/lib
    CONFIG(release, debug|release): LIBS += -LC:/SFML/lib/ -lsfml-window -lsfml-main -lsfml-system
    CONFIG(debug, debug|release): LIBS += -LC:/SFML/lib/ -lsfml-window-d -lsfml-main-d -lsfml-system-d
    INCLUDEPATH += C:/SFML/include
    DEPENDPATH += C:/SFML/include
    
    jsulmJ 1 Reply Last reply
    0
    • B BrMisha

      Hi!
      I built some small console application using SFML lib, but it falls when i run it from creator (I see only "Press <RETURN> to close this window..."), but it works if i'm starting .exe file.
      I added "c:\SFML\bin" to PATH.
      pro file:

      QT -= gui
      
      CONFIG += c++11 console
      CONFIG -= app_bundle
      
      DEFINES += QT_DEPRECATED_WARNINGS
      
      SOURCES += \
              main.cpp #UDP.cpp
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      LIBS += -LC:/SFML/lib
      CONFIG(release, debug|release): LIBS += -LC:/SFML/lib/ -lsfml-window -lsfml-main -lsfml-system
      CONFIG(debug, debug|release): LIBS += -LC:/SFML/lib/ -lsfml-window-d -lsfml-main-d -lsfml-system-d
      INCLUDEPATH += C:/SFML/include
      DEPENDPATH += C:/SFML/include
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @BrMisha Any error messages?
      Can you post the code?

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

      1 Reply Last reply
      2
      • B Offline
        B Offline
        BrMisha
        wrote on last edited by
        #3

        Yes)))

        int main(int argc, char *argv[])
        {
        	QCoreApplication a(argc, argv);
        	return a.exec();
        }
        

        How i can understand, problems with attached libs

        jsulmJ 1 Reply Last reply
        0
        • B BrMisha

          Yes)))

          int main(int argc, char *argv[])
          {
          	QCoreApplication a(argc, argv);
          	return a.exec();
          }
          

          How i can understand, problems with attached libs

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

          @BrMisha Interesting. Usually it is other way around: it starts in QtCreator, but not outside :-)
          Probably the system can't find the lib for some reason when you start the app from QtCreator.
          Do you build in Debug mode?

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

          1 Reply Last reply
          2
          • B Offline
            B Offline
            BrMisha
            wrote on last edited by
            #5

            Yeah, debug, but with release some situation.
            At first, it did fall when i did start .exe also, but then i added .dll folder to path.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              BrMisha
              wrote on last edited by
              #6

              by the way, libs linked in pro file if .a, not .dll. May be it is problem?

              1 Reply Last reply
              0
              • B Offline
                B Offline
                BrMisha
                wrote on last edited by
                #7

                WOW!!!
                In pro i set links to dll and now i can start from creator)))

                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