Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QtWidgets/qwidget.h: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

QtWidgets/qwidget.h: No such file or directory

Scheduled Pinned Locked Moved Solved Installation and Deployment
11 Posts 4 Posters 8.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.
  • M Offline
    M Offline
    mcggoal
    wrote on last edited by
    #1

    hi, Experts

    I'm a new to QT. Now I have met a problem when trying to build a simple program of cross-compile using xilinx arm compiler.

    My develop environment is VMware/Ubuntu16.04 environment.
    I haved installed QT-everywhere-5.4.2 and Qt creator 3.2.82(3.3.0-rc1 opensource), also I have configure the build environment of the Qt creator.
    0_1558090793644_0517-1.PNG
    0_1558090802972_0517-2.PNG 0_1558090809623_0517-3.PNG

    when I build a basic program, the error reported:

    18:19:27: Running steps for project hello_test...
    18:19:27: Starting: "/usr/local/bin/qmake" /home/mcggoal/hello_test/hello_test.pro -r -spec /usr/local/mkspecs/arm-xilinx-linux-gnueabi-g++ CONFIG+=debug
    18:19:27: The process "/usr/local/bin/qmake" exited normally.
    18:19:27: Starting: "/usr/bin/make"
    arm-xilinx-linux-gnueabi-g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../hello_test -I. -isystem /usr/local/include/QtWidgets -isystem /usr/local/include/QtGui -isystem /usr/local/include/QtCore -I. -I. -I/usr/local/mkspecs/arm-xilinx-linux-gnueabi-g++ -o main.o ../hello_test/main.cpp
    cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
    cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
    cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
    In file included from /usr/local/include/QtWidgets/QMainWindow:1:0,
    from ../hello_test/mainwindow.h:4,
    from ../hello_test/main.cpp:1:
    /usr/local/include/QtWidgets/qmainwindow.h:37:31: fatal error: QtWidgets/qwidget.h: No such file or directory
    #include <QtWidgets/qwidget.h>
    ^
    compilation terminated.
    Makefile:326: recipe for target 'main.o' failed
    make: *** [main.o] Error 1
    18:19:27: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project hello_test (kit: XLNX-GCC)
    When executing step "Make"
    18:19:27: Elapsed time: 00:00.

    but when I check the /usr/local/lib,QtWidgets/qwidget.h is just there, now I am confused and hoping someone to give some suggestions.
    Thanks!

    raven-worxR aha_1980A 2 Replies Last reply
    0
    • M mcggoal

      hi, Experts

      I'm a new to QT. Now I have met a problem when trying to build a simple program of cross-compile using xilinx arm compiler.

      My develop environment is VMware/Ubuntu16.04 environment.
      I haved installed QT-everywhere-5.4.2 and Qt creator 3.2.82(3.3.0-rc1 opensource), also I have configure the build environment of the Qt creator.
      0_1558090793644_0517-1.PNG
      0_1558090802972_0517-2.PNG 0_1558090809623_0517-3.PNG

      when I build a basic program, the error reported:

      18:19:27: Running steps for project hello_test...
      18:19:27: Starting: "/usr/local/bin/qmake" /home/mcggoal/hello_test/hello_test.pro -r -spec /usr/local/mkspecs/arm-xilinx-linux-gnueabi-g++ CONFIG+=debug
      18:19:27: The process "/usr/local/bin/qmake" exited normally.
      18:19:27: Starting: "/usr/bin/make"
      arm-xilinx-linux-gnueabi-g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../hello_test -I. -isystem /usr/local/include/QtWidgets -isystem /usr/local/include/QtGui -isystem /usr/local/include/QtCore -I. -I. -I/usr/local/mkspecs/arm-xilinx-linux-gnueabi-g++ -o main.o ../hello_test/main.cpp
      cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
      cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
      cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
      In file included from /usr/local/include/QtWidgets/QMainWindow:1:0,
      from ../hello_test/mainwindow.h:4,
      from ../hello_test/main.cpp:1:
      /usr/local/include/QtWidgets/qmainwindow.h:37:31: fatal error: QtWidgets/qwidget.h: No such file or directory
      #include <QtWidgets/qwidget.h>
      ^
      compilation terminated.
      Makefile:326: recipe for target 'main.o' failed
      make: *** [main.o] Error 1
      18:19:27: The process "/usr/bin/make" exited with code 2.
      Error while building/deploying project hello_test (kit: XLNX-GCC)
      When executing step "Make"
      18:19:27: Elapsed time: 00:00.

      but when I check the /usr/local/lib,QtWidgets/qwidget.h is just there, now I am confused and hoping someone to give some suggestions.
      Thanks!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @mcggoal
      in your .pro file did you add QT += widgets?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      M 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @mcggoal
        in your .pro file did you add QT += widgets?

        M Offline
        M Offline
        mcggoal
        wrote on last edited by
        #3

        @raven-worx, thanks for quick response
        my .pro file is below, there is QT += widgets:

        QT += core gui

        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

        TARGET = hello_test
        TEMPLATE = app

        SOURCES += main.cpp
        mainwindow.cpp

        HEADERS += mainwindow.h

        FORMS += mainwindow.ui

        jsulmJ 1 Reply Last reply
        0
        • M mcggoal

          @raven-worx, thanks for quick response
          my .pro file is below, there is QT += widgets:

          QT += core gui

          greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

          TARGET = hello_test
          TEMPLATE = app

          SOURCES += main.cpp
          mainwindow.cpp

          HEADERS += mainwindow.h

          FORMS += mainwindow.ui

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

          @mcggoal Your Kit has a red exclamation mark. Put the mouse cursor there and see what it complains about.
          To be sure: your Qt in /usr/local is the one you cross compiled?

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

          M 1 Reply Last reply
          3
          • M mcggoal

            hi, Experts

            I'm a new to QT. Now I have met a problem when trying to build a simple program of cross-compile using xilinx arm compiler.

            My develop environment is VMware/Ubuntu16.04 environment.
            I haved installed QT-everywhere-5.4.2 and Qt creator 3.2.82(3.3.0-rc1 opensource), also I have configure the build environment of the Qt creator.
            0_1558090793644_0517-1.PNG
            0_1558090802972_0517-2.PNG 0_1558090809623_0517-3.PNG

            when I build a basic program, the error reported:

            18:19:27: Running steps for project hello_test...
            18:19:27: Starting: "/usr/local/bin/qmake" /home/mcggoal/hello_test/hello_test.pro -r -spec /usr/local/mkspecs/arm-xilinx-linux-gnueabi-g++ CONFIG+=debug
            18:19:27: The process "/usr/local/bin/qmake" exited normally.
            18:19:27: Starting: "/usr/bin/make"
            arm-xilinx-linux-gnueabi-g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../hello_test -I. -isystem /usr/local/include/QtWidgets -isystem /usr/local/include/QtGui -isystem /usr/local/include/QtCore -I. -I. -I/usr/local/mkspecs/arm-xilinx-linux-gnueabi-g++ -o main.o ../hello_test/main.cpp
            cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
            cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
            cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
            In file included from /usr/local/include/QtWidgets/QMainWindow:1:0,
            from ../hello_test/mainwindow.h:4,
            from ../hello_test/main.cpp:1:
            /usr/local/include/QtWidgets/qmainwindow.h:37:31: fatal error: QtWidgets/qwidget.h: No such file or directory
            #include <QtWidgets/qwidget.h>
            ^
            compilation terminated.
            Makefile:326: recipe for target 'main.o' failed
            make: *** [main.o] Error 1
            18:19:27: The process "/usr/bin/make" exited with code 2.
            Error while building/deploying project hello_test (kit: XLNX-GCC)
            When executing step "Make"
            18:19:27: Elapsed time: 00:00.

            but when I check the /usr/local/lib,QtWidgets/qwidget.h is just there, now I am confused and hoping someone to give some suggestions.
            Thanks!

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by aha_1980
            #5

            @mcggoal

            1. If you really want to use such an old QtCreator version, you should at least update to the final or patch release (3.3.0 or better 3.3.1). I'd recommend updating to a recent one like 4.8.2

            You can use the old Qt version without problems with a new Creator version.

            1. your Kit is misconfigured, as the compiler says it sees a mix of native and cross Qt versions. Start investigation as @jsulm said.

            Did you setup this system following a tutorial?

            Regards

            Qt has to stay free or it will die.

            M 1 Reply Last reply
            2
            • jsulmJ jsulm

              @mcggoal Your Kit has a red exclamation mark. Put the mouse cursor there and see what it complains about.
              To be sure: your Qt in /usr/local is the one you cross compiled?

              M Offline
              M Offline
              mcggoal
              wrote on last edited by
              #6

              @jsulm
              The QT kit red mark is reported as "Mkspec not found for your QT version" , I set the Qt Mkspec as "/usr/local/mkspecs/arm-xilinx-linux-gnueabi-g++" , and this dir did exist there:
              0_1558316176296_0520-1.PNG

              Does it mean my QT version is not compatible with QT creator ?

              1 Reply Last reply
              0
              • aha_1980A aha_1980

                @mcggoal

                1. If you really want to use such an old QtCreator version, you should at least update to the final or patch release (3.3.0 or better 3.3.1). I'd recommend updating to a recent one like 4.8.2

                You can use the old Qt version without problems with a new Creator version.

                1. your Kit is misconfigured, as the compiler says it sees a mix of native and cross Qt versions. Start investigation as @jsulm said.

                Did you setup this system following a tutorial?

                Regards

                M Offline
                M Offline
                mcggoal
                wrote on last edited by
                #7

                @aha_1980
                I have updated QT creator to newest version 4.9.0.
                Also I have cleared all the red exclamation mark in kits tab.
                0_1558321106908_0520-2.PNG

                But the fault is still there:

                cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
                cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
                cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
                In file included from /usr/local/include/QtWidgets/QMainWindow:1:0,
                from ../hello_test/mainwindow.h:4,
                from ../hello_test/main.cpp:1:
                /usr/local/include/QtWidgets/qmainwindow.h:37:31: fatal error: QtWidgets/qwidget.h: No such file or directory
                #include <QtWidgets/qwidget.h>
                ^
                compilation terminated.
                Makefile:332: recipe for target 'main.o' failed
                make: *** [main.o] Error 1
                make: *** Waiting for unfinished jobs....
                10:54:35: The process "/usr/bin/make" exited with code 2.
                Error while building/deploying project hello_test (kit: XLNX-GCC)
                When executing step "Make"
                10:54:35: Elapsed time: 00:00.

                aha_1980A 1 Reply Last reply
                0
                • M mcggoal

                  @aha_1980
                  I have updated QT creator to newest version 4.9.0.
                  Also I have cleared all the red exclamation mark in kits tab.
                  0_1558321106908_0520-2.PNG

                  But the fault is still there:

                  cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
                  cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
                  cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
                  In file included from /usr/local/include/QtWidgets/QMainWindow:1:0,
                  from ../hello_test/mainwindow.h:4,
                  from ../hello_test/main.cpp:1:
                  /usr/local/include/QtWidgets/qmainwindow.h:37:31: fatal error: QtWidgets/qwidget.h: No such file or directory
                  #include <QtWidgets/qwidget.h>
                  ^
                  compilation terminated.
                  Makefile:332: recipe for target 'main.o' failed
                  make: *** [main.o] Error 1
                  make: *** Waiting for unfinished jobs....
                  10:54:35: The process "/usr/bin/make" exited with code 2.
                  Error while building/deploying project hello_test (kit: XLNX-GCC)
                  When executing step "Make"
                  10:54:35: Elapsed time: 00:00.

                  aha_1980A Offline
                  aha_1980A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @mcggoal

                  Did you setup this system following a tutorial?

                  Qt has to stay free or it will die.

                  M 2 Replies Last reply
                  0
                  • aha_1980A aha_1980

                    @mcggoal

                    Did you setup this system following a tutorial?

                    M Offline
                    M Offline
                    mcggoal
                    wrote on last edited by
                    #9

                    @aha_1980
                    first , I install QT 5.4.2-anywhere using the xilinx tutorial:
                    https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842110/Qt+Qwt+Build+Instructions+Qt+5.4.2+Qwt+6.1.2

                    Next , I install and configure the QT creator followed :
                    https://www.ics.com/blog/configuring-qt-creator-raspberry-pi

                    1 Reply Last reply
                    0
                    • aha_1980A aha_1980

                      @mcggoal

                      Did you setup this system following a tutorial?

                      M Offline
                      M Offline
                      mcggoal
                      wrote on last edited by
                      #10

                      @aha_1980 @jsulm @raven-worx
                      thanks for your help, I reinstall the qt-anywhere according to xilinx, and this time the compilation is OK , although several warnnings for unsafe cross-compile as below:

                      cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
                      cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
                      cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
                      cc1plus: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]
                      cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
                      cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
                      cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
                      cc1plus: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]

                      aha_1980A 1 Reply Last reply
                      0
                      • M mcggoal

                        @aha_1980 @jsulm @raven-worx
                        thanks for your help, I reinstall the qt-anywhere according to xilinx, and this time the compilation is OK , although several warnnings for unsafe cross-compile as below:

                        cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
                        cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
                        cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
                        cc1plus: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]
                        cc1plus: warning: include location "/usr/local/include/QtWidgets" is unsafe for cross-compilation [-Wpoison-system-directories]
                        cc1plus: warning: include location "/usr/local/include/QtGui" is unsafe for cross-compilation [-Wpoison-system-directories]
                        cc1plus: warning: include location "/usr/local/include/QtCore" is unsafe for cross-compilation [-Wpoison-system-directories]
                        cc1plus: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]

                        aha_1980A Offline
                        aha_1980A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @mcggoal Good! at least a step forward.

                        Cross compilation is an advanced topic and needs quite some experience.

                        Maybe someone else can help you better than me, but at least I've some questions for you:

                        • Do you have another (native) Qt version on your system? If yes, where is it installed?
                        • Do you call an environment-setup script to set-up your cross-compiler? Usually such scripts set the environment variables needed to find the compiler, the tools and also set up the sysroot for your embedded device.
                        • Have you already verified that the files below /usr/local/lib are the cross-compiled ones? You can check with file libXXXX.so. That gives me the impression that the files are wrongly installed. Reason: /lib, /usr/lib, and /usr/local/lib are for native libraries, same applies for /bin, /usr/bin and /usr/local/bin for the binaries. Cross compiled binaries and should rather be installed in /opt or in your home directory.

                        Regards

                        Qt has to stay free or it will die.

                        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