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. executable runs fine from local directory / throws error with IDE.
Forum Updated to NodeBB v4.3 + New Features

executable runs fine from local directory / throws error with IDE.

Scheduled Pinned Locked Moved General and Desktop
27 Posts 4 Posters 6.8k Views 4 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.
  • M Offline
    M Offline
    mcosta
    wrote on last edited by
    #2

    Hi,

    you should verify the QT Creator "Run" settings for your Project.
    If you're able to run the program manually it means that the build is correct; probably in the "Run" settings some environmental settings are incorrect

    Once your problem is solved don't forget to:

    • Mark the thread as SOLVED using the Topic Tool menu
    • Vote up the answer(s) that helped you to solve the issue

    You can embed images using (http://imgur.com/) or (http://postimage.org/)

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

      I haven't changed the run section at all that I can think of. My path= may have something incorrect, and am posting it:

      It is bloated and much of it unnecessary, but here is:

      C:\Qt\5.4\mingw491_32\bin;C:\Qt\Tools\mingw491_32\bin;%OPENCV%\build\x86\vc11\bin;C:\OpenCV-2.3.1\install\include\opencv;C:\OpenCV-2.3.1\bin;C:\OpenCV-2.3.1\install;C:\opencv-win\opencv\build\include\opencv2\core; c:\OpenCV-2.3.1\bin;C:\opencv-win\opencv\sources\modules;C:\Qt\5.4\mingw491_32\bin;C:\Qt\Tools\mingw491_32\bin;C:\Qt\5.4\mingw491_32\bin;C:\Users\Technologist;C:\Qt\Tools\QtCreator\bin;C:\OpenCV-2.3.1\bin;
      

      Now HelloWorld (as a test) isn't working either. C:\Users\Technologist\Documents\AnotherNewOne\main.cpp:
      1: error: qapplication.h: No such file or directory

      #include <qapplication.h>

      Straight from the tutorial:

      Qt Tutorial - Chapter 1: Hello, World!
      qapplication.h : I did a system wide search for the file with no luck.

      Its all related I think

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

        Hi,

        Do you have a link to that tutorial ? In any case, you should use the QApplication include, that's the official supported way to do the includes

        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
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #5

          @Technologist You started a thread with a problem related to an executable runnable manually but not using the IDE and after you started talking about code from a (BAD or OLD) tutorial.

          This is a little bit confusing for people that want to help you.
          Please focus on the initial problem.

          What I can see from the path you posted I think the OpenCV is built with Visual C++; so you have to check that is built for 32bit platform

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

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

            Sorry that was unintentional. I don't want to waste anyone's time.The old code compiled created the executable that successfully ran outside of the IDE. Was trying to relate different parts of the problem. Bottom line: am still having issues with the executable working outside the IDE but not within it, and hellonotepad not working making me think the two are related. Helloworld was to test this hypothesis. The build - it was done 32 bit compiler - using cmake. That fact that both simple programs wont work makes me wonder whether reinstall would be good ro to just hang in there.

            Hellonotepad link:
            https://web.njit.edu/all_topics/Prog_Lang_Docs/html/qt/tutorial1-01.html

            #include <QApplication>
             2        #include <QTextEdit>
             3
             4        int main(int argv, char **args)
             5        {
             6            QApplication app(argv, args);
             7
             8            QTextEdit textEdit;
             9            textEdit.show();
            10
            11            return app.exec();
            12        }
            

            .pro file -> nothing unusual

            C:\Users\Technologist\Documents\simpleapp\main.cpp:1: error: QApplication: No such file or directory
            #include <QApplication>

            Thanks for your time.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcosta
              wrote on last edited by
              #7

              No problem,

              the link you posted refers to avery old Qt version (3.0.5).
              Can you post the CMakeLists.txt?? If the compiler doesn't find QApplication something is not set correctly on the CMakeLists.txt

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

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

                Sorry I have cmakelists.txt everywhere it seems. What is t he most relevant dir to pull it from?

                Would a makefile from the release directory of the program be helpful?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mcosta
                  wrote on last edited by
                  #9

                  The one you using to build the example

                  Once your problem is solved don't forget to:

                  • Mark the thread as SOLVED using the Topic Tool menu
                  • Vote up the answer(s) that helped you to solve the issue

                  You can embed images using (http://imgur.com/) or (http://postimage.org/)

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

                    Can you please be more specific. In the build directory for the app there are no cmakelists.txt. I am really just learning this particular aspect of programming. Makefiles in the build directory. "Run and Build"-->I don't know where to make file is ...

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mcosta
                      wrote on last edited by
                      #11

                      HI,

                      you said you're using CMake, so you should post the CMakeLists.txt in the source directory

                      Once your problem is solved don't forget to:

                      • Mark the thread as SOLVED using the Topic Tool menu
                      • Vote up the answer(s) that helped you to solve the issue

                      You can embed images using (http://imgur.com/) or (http://postimage.org/)

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

                        I used CMake to build the library, use qmake to build and run projects via the green button.

                        Ok I found a cmakelists.txt in the source directory of the opencv build, but too large to paste.
                        The next make file was in the program directory.

                        #############################################################################
                        # Makefile for building: simpleapp
                        # Generated by qmake (3.0) (Qt 5.4.1)
                        # Project:  ..\simpleapp\simpleapp.pro
                        # Template: app
                        # Command: C:\Qt\5.4\mingw491_32\bin\qmake.exe -spec win32-g++ -o Makefile ..\simpleapp\simpleapp.pro
                        #############################################################################
                        
                        MAKEFILE      = Makefile
                        
                        first: release
                        install: release-install
                        uninstall: release-uninstall
                        QMAKE         = C:\Qt\5.4\mingw491_32\bin\qmake.exe
                        DEL_FILE      = del
                        CHK_DIR_EXISTS= if not exist
                        MKDIR         = mkdir
                        COPY          = copy /y
                        COPY_FILE     = $(COPY)
                        COPY_DIR      = xcopy /s /q /y /i
                        INSTALL_FILE  = $(COPY_FILE)
                        INSTALL_PROGRAM = $(COPY_FILE)
                        INSTALL_DIR   = $(COPY_DIR)
                        DEL_FILE      = del
                        SYMLINK       = copy /y
                        DEL_DIR       = rmdir
                        MOVE          = move
                        SUBTARGETS    =  \
                        		release \
                        		debug
                        
                        
                        release: FORCE
                        	$(MAKE) -f $(MAKEFILE).Release
                        release-make_first: FORCE
                        	$(MAKE) -f $(MAKEFILE).Release 
                        release-all: FORCE
                        	$(MAKE) -f $(MAKEFILE).Release all
                        release-clean: FORCE
                        	$(MAKE) -f $(MAKEFILE).Release clean
                        release-distclean: FORCE
                        	$(MAKE) -f $(MAKEFILE).Release distclean
                        release-install: FORCE
                        	$(MAKE) -f $(MAKEFILE).Release install
                        release-uninstall: FORCE
                        	$(MAKE) -f $(MAKEFILE).Release uninstall
                        debug: FORCE
                        	$(MAKE) -f $(MAKEFILE).Debug
                        debug-make_first: FORCE
                        	$(MAKE) -f $(MAKEFILE).Debug 
                        debug-all: FORCE
                        	$(MAKE) -f $(MAKEFILE).Debug all
                        debug-clean: FORCE
                        	$(MAKE) -f $(MAKEFILE).Debug clean
                        debug-distclean: FORCE
                        	$(MAKE) -f $(MAKEFILE).Debug distclean
                        debug-install: FORCE
                        	$(MAKE) -f $(MAKEFILE).Debug install
                        debug-uninstall: FORCE
                        	$(MAKE) -f $(MAKEFILE).Debug uninstall
                        
                        Makefile: ../simpleapp/simpleapp.pro ../../../../Qt/5.4/mingw491_32/mkspecs/win32-g++/qmake.conf ../../../../Qt/5.4/mingw491_32/mkspecs/features/spec_pre.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/qdevice.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/device_config.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/common/shell-win32.conf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/qconfig.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_axbase.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_axbase_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_axcontainer.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_axcontainer_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_axserver.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_axserver_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_bluetooth.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_bluetooth_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_bootstrap_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_clucene_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_concurrent.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_concurrent_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_core.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_core_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_dbus.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_dbus_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_declarative.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_declarative_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_designer.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_designer_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_designercomponents_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_enginio.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_enginio_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_gui.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_gui_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_help.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_help_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_location.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_location_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_multimedia.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_multimedia_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_multimediawidgets.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_network.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_network_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_nfc.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_nfc_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_opengl.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_opengl_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_openglextensions.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_openglextensions_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_platformsupport_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_positioning.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_positioning_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_printsupport.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_printsupport_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_qml.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_qml_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_qmldevtools_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_qmltest.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_qmltest_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_quick.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_quick_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_quickparticles_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_quickwidgets.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_quickwidgets_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_script.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_script_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_scripttools.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_scripttools_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_sensors.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_sensors_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_serialport.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_serialport_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_sql.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_sql_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_svg.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_svg_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_testlib.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_testlib_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_uitools.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_uitools_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webchannel.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webchannel_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webkit.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webkit_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webkitwidgets.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webkitwidgets_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_websockets.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_websockets_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webview.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_webview_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_widgets.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_widgets_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_winextras.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_winextras_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_xml.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_xml_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_xmlpatterns.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/qt_functions.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/qt_config.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/win32/qt_config.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/win32-g++/qmake.conf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/spec_post.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/exclusive_builds.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/default_pre.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/win32/default_pre.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/resolve_config.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/exclusive_builds_post.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/default_post.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/win32/console.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/win32/rtti.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/precompile_header.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/warn_on.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/qt.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/resources.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/moc.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/testcase_targets.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/exceptions.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/yacc.prf \
                        		../../../../Qt/5.4/mingw491_32/mkspecs/features/lex.prf \
                        		../simpleapp/simpleapp.pro \
                        		C:/Qt/5.4/mingw491_32/lib/Qt5Core.prl
                        	$(QMAKE) -spec win32-g++ -o Makefile ..\simpleapp\simpleapp.pro
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\spec_pre.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\qdevice.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\device_config.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\common\shell-win32.conf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\qconfig.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_axbase.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_axbase_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_axcontainer.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_axcontainer_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_axserver.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_axserver_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_bluetooth.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_bluetooth_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_bootstrap_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_clucene_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_concurrent.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_concurrent_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_core.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_core_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_dbus.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_dbus_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_declarative.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_declarative_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_designer.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_designer_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_designercomponents_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_enginio.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_enginio_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_gui.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_gui_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_help.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_help_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_location.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_location_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_multimedia.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_multimedia_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_multimediawidgets.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_multimediawidgets_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_network.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_network_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_nfc.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_nfc_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_opengl.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_opengl_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_openglextensions.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_openglextensions_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_platformsupport_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_positioning.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_positioning_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_printsupport.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_printsupport_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_qml.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_qml_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_qmldevtools_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_qmltest.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_qmltest_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_qtmultimediaquicktools_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_quick.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_quick_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_quickparticles_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_quickwidgets.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_quickwidgets_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_script.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_script_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_scripttools.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_scripttools_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_sensors.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_sensors_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_serialport.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_serialport_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_sql.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_sql_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_svg.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_svg_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_testlib.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_testlib_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_uitools.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_uitools_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webchannel.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webchannel_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webkit.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webkit_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webkitwidgets.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webkitwidgets_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_websockets.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_websockets_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webview.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_webview_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_widgets.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_widgets_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_winextras.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_winextras_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_xml.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_xml_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_xmlpatterns.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\modules\qt_lib_xmlpatterns_private.pri:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\qt_functions.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\qt_config.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\win32\qt_config.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++\qmake.conf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\spec_post.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\exclusive_builds.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\default_pre.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\win32\default_pre.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\resolve_config.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\exclusive_builds_post.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\default_post.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\win32\console.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\win32\rtti.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\precompile_header.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\warn_on.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\qt.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\resources.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\moc.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\testcase_targets.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\exceptions.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\yacc.prf:
                        ..\..\..\..\Qt\5.4\mingw491_32\mkspecs\features\lex.prf:
                        ..\simpleapp\simpleapp.pro:
                        C:/Qt/5.4/mingw491_32/lib/Qt5Core.prl:
                        qmake: FORCE
                        	@$(QMAKE) -spec win32-g++ -o Makefile ..\simpleapp\simpleapp.pro
                        
                        qmake_all: FORCE
                        
                        make_first: release-make_first debug-make_first FORCE
                        all: release-all debug-all FORCE
                        clean: release-clean debug-clean FORCE
                        distclean: release-distclean debug-distclean FORCE
                        	-$(DEL_FILE) Makefile
                        
                        release-mocclean:
                        	$(MAKE) -f $(MAKEFILE).Release mocclean
                        debug-mocclean:
                        	$(MAKE) -f $(MAKEFILE).Debug mocclean
                        mocclean: release-mocclean debug-mocclean
                        
                        release-mocables:
                        	$(MAKE) -f $(MAKEFILE).Release mocables
                        debug-mocables:
                        	$(MAKE) -f $(MAKEFILE).Debug mocables
                        mocables: release-mocables debug-mocables
                        
                        check: first
                        FORCE:
                        
                        $(MAKEFILE).Release: Makefile
                        $(MAKEFILE).Debug: Makefile
                        
                        1 Reply Last reply
                        0
                        • JKSHJ Offline
                          JKSHJ Offline
                          JKSH
                          Moderators
                          wrote on last edited by
                          #13

                          Hi @Technologist,

                          Let's take a step back. Do an officially-supported Hello World test:

                          1. Open Qt Creator
                          2. Create a new project: "File" -> "New File or Project..." -> "Application" -> "Qt Widgets Application"
                          3. Click the green button.

                          Does this work? If so, examine the .pro file and look for differences with yours.

                          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

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

                            Ok, I built the "official" hello world app which worked flawlessly. The #include <QApplication>
                            didn't throw an error.

                            I ran the "Unofficial" hello world and compilation stopped secondary to error: qapplication.h: No such file or directory

                            Ive compared both .pro files and I don't see why the unofficial can't find the same include that the "official" hello world can. I'll post

                            "official" HW .pro file/main

                            #-------------------------------------------------
                            #
                            # Project created by QtCreator 2015-04-17T08:55:34
                            #
                            #-------------------------------------------------
                            
                            QT       += core gui
                            
                            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                            
                            TARGET = TestApp
                            TEMPLATE = app
                            
                            
                            SOURCES += main.cpp\
                                    mainwindow.cpp
                            
                            HEADERS  += mainwindow.h
                            
                            FORMS    += mainwindow.ui
                            
                            main.cpp
                            
                            #include "mainwindow.h"
                            #include <QApplication>
                            
                            int main(int argc, char *argv[])
                            {
                                QApplication a(argc, argv);
                                MainWindow w;
                                w.show();
                            
                                return a.exec();
                            }
                            
                            "Unofficial" HW File
                            '''
                            

                            Unofficial Hello world

                            .pro file - qapp/qbutton not found

                            QT       += core
                            
                            QT       -= gui
                            
                            TARGET = HelloWorldUnofficialvsTestApp
                            CONFIG   += console
                            CONFIG   -= app_bundle
                            
                            TEMPLATE = app
                            
                            
                            SOURCES += main.cpp
                            
                            #include <qapplication.h>
                            #include <qpushbutton.h>
                            
                            
                            int main( int argc, char **argv )
                            {
                                QApplication a( argc, argv );
                            
                                QPushButton hello( "Hello world!", 0 );
                                hello.resize( 100, 30 );
                            
                                a.setMainWidget( &hello );
                                hello.show();
                                return a.exec();
                            }
                            1 Reply Last reply
                            0
                            • JKSHJ Offline
                              JKSHJ Offline
                              JKSH
                              Moderators
                              wrote on last edited by JKSH
                              #15

                              @Technologist said:

                              Ive compared both .pro files and I don't see why the unofficial can't find the same include that the "official" hello world can.

                              By default, the Qt Core and Qt GUI modules are available for your project. Let's see how the .pro files change this.

                              "official" HW .pro file
                              QT += widgets

                              This line says, "ADD the Qt Widgets module to my project". This is required to find QApplication and QPushButton, because they belong to the Qt Widgets module. They used to be in the Qt GUI module in Qt 4, but Qt 5 has a new structure. This is one big reason to avoid old tutorials and stick to new ones.

                              Unofficial Hello world
                              QT -= gui

                              This line says, "EXCLUDE the Qt GUI module from my project". This removes all GUI functionality, like OpenGL. Since you want to build an OpenCV app, you probably don't want this option!

                              See https://doc.qt.io/qt-5/qtmodules.html for a list of all available modules.

                              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

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

                                That shows that the configuration problem of .pro file was human error. It found my qt header files. Thanks for the pointer on opel GL etc. This solution rules out a single error behind both. This problem is fixed however the first problem persists: the IDE crashes when I build the "Show Picture" routine, but runs perfectly when I execute it from build directory. Do I need to close out this ticket and reopen it or finish out here?

                                Thanks for your time

                                1 Reply Last reply
                                0
                                • JKSHJ Offline
                                  JKSHJ Offline
                                  JKSH
                                  Moderators
                                  wrote on last edited by JKSH
                                  #17

                                  @Technologist said:

                                  That shows that the configuration problem of .pro file was human error. It found my qt header files. Thanks for the pointer on opel GL etc. This solution rules out a single error behind both. This problem is fixed however the first problem persists: the IDE crashes when I build the "Show Picture" routine, but runs perfectly when I execute it from build directory. Do I need to close out this ticket and reopen it or finish out here?

                                  Thanks for your time

                                  You're welcome :)

                                  Yes, this little excursion helped us to establish that your installation of Qt and the IDE are fine. So, the problem probably lies in your project configuration or environment.

                                  I just noticed that you have Qt and Qt Creator in your PATH. This is very bad, because they both contain different (and incompatible) versions of the same DLL (e.g. Qt5Core.dll). Remove them from your PATH. There is no need for anything Qt-related to be in the PATH, and having them there is the cause of many mysterious crashes.

                                  After cleaning your PATH, try running your program again. (To do it outside the IDE the proper way, see http://wiki.qt.io/Deploy_an_Application_on_Windows )

                                  In general, MSVC and MinGW are incompatible. Qt Creator is a Qt-built program too, which uses MSVC 2010-built Qt DLLs. I also noticed that your copy OpenCV is built with MSVC 2012. I'm not sure if this is compatible with your MinGW-built app.

                                  You can continue posting here, as it's still about your original post.

                                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

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

                                    FYI the platform was built using cmake and mingw, not MSVS (I don't have msvs on the system.) -- if that's coming across from the ?path?. Was it this line: %OPENCV%\buildx86\vc11Honestly I think I put it in the path mistakenly. Can I remove it?

                                    OK cleaned my path. No more missing qt files with Widgets addition to pro file. Application still continue to crash in intialization phase. Sometimes it will throw this error a lot of the time or just open a window and crash. Below it can't find an opencv file.

                                    The program can't start because libgcc_s_dw2-1.dll is missing from your computer Try installing the program to fix this problem.
                                    

                                    New local path: C:\OpenCV-2.3.1\bin;C:\OpenCV-2.3.1\install\include\opencv2;C:\OpenCV-2.3.1\lib;
                                    System path:%OPENCV%\build\x86\vc11\bin; c:\OpenCV-2.3.1\bin;C:\opencv-win\opencv\sources\modules;

                                    error :C:\Users\Technologist\Documents\NewOne\main.cpp:2: error: opencv2/core/core.hpp: No such file or directory #include <opencv2/core/core.hpp>
                                    ^
                                    pro. file:

                                    QT       += core
                                    
                                    QT       += gui
                                    QT       += widgets
                                    
                                    TARGET = NewOne
                                    CONFIG   += console
                                    CONFIG   -= app_bundle
                                    
                                    TEMPLATE = app
                                    
                                    SOURCES += main.cpp
                                    
                                    INCLUDEPATH += "C:/OpenCV-2.3.1/install/include/opencv2/"
                                    
                                    LIBS += -LC:\OpenCV-2.3.1\lib\
                                        -lopencv_core2411.dll.a \
                                        -lopencv_highgui2411.dl.al \
                                        -lopencv_imgproc2411.dll.a \
                                        -lopencv_features2d2411.dll.a \
                                        -lopencv_calib3d2411.dll.a
                                    
                                    #include <QCoreApplication>
                                    #include <opencv2/core/core.hpp>
                                    #include <opencv2/highgui/highgui.hpp>
                                    int main() {
                                            // read an image
                                            cv::Mat image= cv::imread("img.jpg");
                                            // create image window named "My Image"
                                            cv::namedWindow("My Image");
                                            // show the image on window
                                            cv::imshow("My Image", image);
                                            // wait key for 5000 ms
                                            cv::waitKey(5000);
                                            return 1;
                                    }
                                    
                                    
                                    JKSHJ 1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by SGaist
                                      #19

                                      Don't include opencv2 in your INCLUDEPATH entry

                                      INCLUDEPATH += "C:/OpenCV-2.3.1/install/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 Technologist
                                        #20

                                        I don't see any opencv2 in your includepath unless you are referring to the opencv2 down the file directory from there.

                                        INCLUDEPATH += "C:\OpenCV-2.3.1\install\include\opencv2"
                                        

                                        Sorry, now I am feeling newbish.

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

                                          That's the point. Since you use:

                                          #include <opencv2/core/core.hpp>

                                          If you use INCLUDEPATH += "C:/OpenCV-2.3.1/install/include/opencv2/" then the headers won't be found because you are trying to include a file that would be searched like:
                                          "C:/OpenCV-2.3.1/install/include/opencv2/opencv2/core/core.hpp".

                                          So either remove opencv2 from your include lines or remove it from your INCLUDEPATH line.

                                          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