Unable to locate the header files inside subdirectories while migrating to Qt5

Tay2510

I have been migrating from Qt 4.8.5 to Qt 5.3.0 recently, and these are the related information:

  • Windows 7 32 bit
  • Qt 3.1.1
  • MSVC 2010 compiler (Both my Qt versions are pre-compiled package of MSVC2010 edition)
  • debugger from Win7 SDK

Now I've been trapped by a problem that I keep getting compilation errors:

fatal error C1083: Cannot open include file

from those header files inside subdirectories, for example, #include "FooFolder/bar.h". The compiler is unable to locate all this kind of headers and I am totally befuddled since:

  1. The Intellisense works well.
  2. If I change back to old kit Qt 4.8.5, it compiles fine
  3. Both kits use the same MSVC compiler.

Here is my .pro file:

QT += core gui script
QT += printsupport

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MyApp
TEMPLATE = app

SOURCES += main.cpp\
        mainwindow.cpp \
    qcustomplot.cpp \
    dialogs/filterdialog.cpp \
    databox/databox.cpp \
    databox/datom.cpp \
    #... and more FooFolder/bar.cpp

HEADERS  += mainwindow.h \
    qcustomplot.h \
    dialogs/filterdialog.h \
    databox/databox.h \
    databox/datom.h \
    #... and more FooFolder/bar.h        

RESOURCES += \
    resources.qrc

win32: LIBS += -LC:/ADLINK/UDASK/lib/ -lusb-dask \    
INCLUDEPATH += C:/ADLINK/UDASK/include \
DEPENDPATH += C:/ADLINK/UDASK/include \

include(qext/qextserialport.pri)

and here is one of the .h file that files to include other subdirectoried headers

#ifndef SETWINDOW_H
#define SETWINDOW_H
#include <QObject>
#include "databox/databox.h" // <---fatal error C1083: Cannot open include file 

class SetWindow: public QObject
{
    Q_OBJECT

public:
    SetWindow();

public Q_SLOTS:
    void setPointNum(int n);
    void setStepSize(int s);    
    int getPointNum();
    int getStepSize();
    void requestSignal();

Q_SIGNALS:
    void sendParameters(int p, int s);

private:
    QString DynamicString;
    DataBox *presentData;

    int m_PointNum;
    int m_StepSize;
};

#endif // SETWINDOW_H

and the header file failed to be included:

#ifndef DATABOX_H
#define DATABOX_H
#include <QVector>
#include <QFile>
#include <QMap>
#include <QString>
#include "datom.h"

class Measurement
{
public:
    Measurement();
    void setNumChan(int n);
    void setADRange(QString &s);
    void setSamplingRate(int n);
    void setTimeBase(double d);

    int NumChan;
    QString ADRange;
    int SamplingRate;
    double TimeBase;
};

class DataBox
{    
public:
    DataBox();

    void setCurrentFile(QString path);
    void loadData();
    void cleanAll();    

    QVector<double>* py_0;    
    QVector<double>* py_1;
    QVector<double>* ptimeStamp;
    QVector<double>* pi_M;
    QVector<double>* py_M;
    QVector<double>* py_W;

    QMap<double, double> AI_0;
    QMap<double, double> AI_1;
    QMap<int, double> AI0;
    QMap<int, double> AI1;

    double timeBase;

    Measurement parameters;
    QVector<Datom> *dataPoints;

private:
    QString currentFile;
};

#endif // DATABOX_H
lpapp

These seem to be incorrect:

win32: LIBS += -LC:/ADLINK/UDASK/lib/ -lusb-dask \

INCLUDEPATH += C:/ADLINK/UDASK/include \
DEPENDPATH += C:/ADLINK/UDASK/include \

1) \ means it joins the next line which is not what you wish. It is not an issue for the lines with followed empty line, but it is not good for the INCLUDEPATH in here, and if you replace the empty lines with some containment, you could run into issues with the other lines, too.

2) You will also need to put $$PWD into the includepath to get the project root "registered" since your include should start from there, not the current working directory of the source since that is not the right route as you can assume.

Therefore, you would be writing something like this:

win32: LIBS += -LC:/ADLINK/UDASK/lib/ -lusb-dask

INCLUDEPATH += $$PWD C:/ADLINK/UDASK/include
DEPENDPATH += C:/ADLINK/UDASK/include

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android NDK with Qt not able to locate header files

From Dev

Unable to locate element inside Gmail

From Dev

Making subdirectories while copying files

From Dev

PhpUnit unable to locate test files

From Dev

PhpUnit unable to locate test files

From Dev

Can I search directory and subdirectories for header files?

From Dev

Can I search directory and subdirectories for header files?

From Dev

Loop over json files inside subdirectories

From Dev

How to use .cpp and .h files inside subdirectories?

From Dev

Unable to locate package while building Docker image

From Dev

Unable to locate package qt5-default in LXD container

From Dev

g++ linker is unable to locate functions despite header inclusion

From Dev

Packages cannot locate QT5 (BLFS 8.4)

From Dev

Selenium WebDriver: unable to locate element inside iframe using TinyMCE editor

From Dev

Unable to locate credentials inside fargate container, using Boto3

From Dev

Locate does not locate files

From Dev

Locate does not locate files

From Dev

Zipping all files and subdirectories inside a folder using batch file

From Dev

Creating grunt tasks for compiling coffeescript files recursively inside directories and subdirectories

From Dev

Powershell script to open a number of files located inside subdirectories

From Dev

How can I move files using bash/for loop inside subdirectories?

From Dev

installing android OpenCV unable to locate error while building

From Dev

"Unable to locate package" while trying to install packages with APT

From Dev

Unable to locate element 'username' while logging in Instagram with Selenium hosted on Heroku

From Dev

"Unable to locate package" while trying to install packages with APT

From Dev

How to rename multiple folders while keeping their files subdirectories

From Dev

Unable to locate package php5-readline

From Dev

Unable to see files inside a container

From Dev

Unable to locate Spring framework's 4.0.6 jar files?

Related Related

  1. 1

    Android NDK with Qt not able to locate header files

  2. 2

    Unable to locate element inside Gmail

  3. 3

    Making subdirectories while copying files

  4. 4

    PhpUnit unable to locate test files

  5. 5

    PhpUnit unable to locate test files

  6. 6

    Can I search directory and subdirectories for header files?

  7. 7

    Can I search directory and subdirectories for header files?

  8. 8

    Loop over json files inside subdirectories

  9. 9

    How to use .cpp and .h files inside subdirectories?

  10. 10

    Unable to locate package while building Docker image

  11. 11

    Unable to locate package qt5-default in LXD container

  12. 12

    g++ linker is unable to locate functions despite header inclusion

  13. 13

    Packages cannot locate QT5 (BLFS 8.4)

  14. 14

    Selenium WebDriver: unable to locate element inside iframe using TinyMCE editor

  15. 15

    Unable to locate credentials inside fargate container, using Boto3

  16. 16

    Locate does not locate files

  17. 17

    Locate does not locate files

  18. 18

    Zipping all files and subdirectories inside a folder using batch file

  19. 19

    Creating grunt tasks for compiling coffeescript files recursively inside directories and subdirectories

  20. 20

    Powershell script to open a number of files located inside subdirectories

  21. 21

    How can I move files using bash/for loop inside subdirectories?

  22. 22

    installing android OpenCV unable to locate error while building

  23. 23

    "Unable to locate package" while trying to install packages with APT

  24. 24

    Unable to locate element 'username' while logging in Instagram with Selenium hosted on Heroku

  25. 25

    "Unable to locate package" while trying to install packages with APT

  26. 26

    How to rename multiple folders while keeping their files subdirectories

  27. 27

    Unable to locate package php5-readline

  28. 28

    Unable to see files inside a container

  29. 29

    Unable to locate Spring framework's 4.0.6 jar files?

HotTag

Archive