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. [Qt 5.3.1] Issue to to find its own source files

[Qt 5.3.1] Issue to to find its own source files

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 3 Posters 1.8k 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.
  • T Offline
    T Offline
    Tutaum
    wrote on last edited by
    #1

    Hey guys I am currently trying to compile and build a project which I believe was done on Qt 4.x.x, but I'm not really sure.
    The problem is that all Qt internal source files are having problems to find each other, basically they cannot find themselves if they are declared inside their respective folder, but when I remove the folder path and just keep the file name it works, but I don't think I'm supposed to do changes on these includes. Let me give an example to explain myself better:

    Error: @ opt/Qt5.3.1/5.3/gcc_64/include/QtGui/qguiapplication.h:45
    error: QtCore/qcoreapplication.h: No such file or directory
    #include <QtCore/qcoreapplication.h>
    @

    However, when remove the QtCore/ folder from the include leaving just #include <qcoreapplication.h> it manages to find the file. I suspect this is something that should be changed or added to the pro file, but I have no idea what. Anyway I'm attaching the pro file here so you guys can take a look as well.

    @QT += core gui
    QT += widgets

    CONFIG += qt

    TARGET = visor
    TEMPLATE = app

    SOURCES += main.cpp\
    mainwindow.cpp \
    imagestitcher.cpp \
    objectrecognizer.cpp \
    sharedfunctions.cpp \
    customgraphicsview.cpp \
    customslider.cpp \
    metadataparser.cpp

    HEADERS += mainwindow.h \
    imagestitcher.h \
    objectrecognizer.h \
    sharedfunctions.h \
    customgraphicsview.h \
    customslider.h \
    metadataparser.h

    FORMS += mainwindow.ui

    INCLUDEPATH += pkg-config --cflags opencv

    LIBS += -L/usr/local/lib
    LIBS += pkg-config --libs opencv

    @

    I though on removing all the folder all includes but there is simply a huge amount of Qt source files and it seems quite a incorrect way to solve the issue.

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

      Hi and welcome to devnet,

      Can you show an example of the include used in the project ? e.g. from customslider

      On a side note, you can simplify the OpenCV handling with

      @
      CONFIG += link_pkgconfig
      PKGCONFIG += opencv@

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

        Sure, all the mess along Qt's internal source files starts when I call include QGuiApplication in my main.cpp:

        @
        #include <QGuiApplication>
        #include "mainwindow.h"

        int main(int argc, char *argv[])
        {
        QApplication a(argc, argv);
        MainWindow w;
        w.show();

        return a.exec()
        }
        @

        BTW Thx for the side note :)

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

          Looks strange… How did you install Qt ?

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

            I bet when you set the prefix during the Qt build it was something that caused this problem.

            Can you post the result of:

            @
            qmake -query
            @

            And where is your Qt located, full path to the include directory.

            If my guess is right on this you can fix the path with a qt.conf file in your bin directory. I can give you the syntax for the file once I see your path and variables from qmake -query.

            My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

            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