Results 1 to 2 of 2

Thread: QtCore/QtGlobal: No such file or directory when building static archive

  1. #1
    Join Date
    Jun 2014
    Posts
    30
    Thanks
    4
    Qt products
    Qt5

    Default QtCore/QtGlobal: No such file or directory when building static archive

    I am trying to build two libraries: one static one shared. The problem is with the static library. I have the following folders:

    Qt Code:
    1. src/
    2. db/
    3. dbal.h
    4. dbal.pro
    5. dll/
    6. Distribution.h
    7. dll.pro
    8. project.pro
    To copy to clipboard, switch view to plain text mode 

    db is static and dll is shared

    Distribution.h

    Qt Code:
    1. #ifndef DISTRIBUTION_H_
    2. #define DISTRIBUTION_H_
    3.  
    4. #include <QtCore/QtGlobal>
    5.  
    6. #if defined(BUILDING_DLL)
    7. #define DLL_FUNCTION Q_DECL_EXPORT
    8. #else
    9. #define DLL_FUNCTION Q_DECL_IMPORT
    10. #endif
    11.  
    12. #endif /* DISTRIBUTION_H_ */
    To copy to clipboard, switch view to plain text mode 

    Now here is the file inside db/ that includes Distribution.h

    dbal.h

    Qt Code:
    1. #ifndef DBAL_H_
    2. #define DBAL_H_
    3.  
    4. #include "Distribution.h"
    5.  
    6. ...
    7.  
    8. #endif
    To copy to clipboard, switch view to plain text mode 

    db.pro

    Qt Code:
    1. TARGET = db
    2. TEMPLATE = lib
    3. CONFIG = staticlib c++11
    4.  
    5. QT += core
    6.  
    7. INCLUDEPATH += ../dll
    8.  
    9. HEADERS += dbal.h
    10. HEADERS += dbal_sqlite.h
    11.  
    12. SOURCES += dbal.cpp
    13. SOURCES += dbal_sqlite.cpp
    14.  
    15. ######################################################################
    16. # Build to custom directories
    17. ######################################################################
    18.  
    19. DESTDIR = ../../build/debug/db
    20.  
    21. OBJECTS_DIR = $$DESTDIR/.obj
    22. MOC_DIR = $$DESTDIR/.moc
    23. RCC_DIR = $$DESTDIR/.qrc
    24. UI_DIR = $$DESTDIR/.ui
    To copy to clipboard, switch view to plain text mode 

    When I run make in the db/ folder I get the following error: QtCore/QtGlobal: No such file or directory. It also appears that there are missing -I commands.

    Here is my log:

    Qt Code:
    1. make all
    2. cd src/db/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /mnt/record/_dev/linux/projects/cdt/wasp/src/db/db.pro -o Makefile ) && make -f Makefile all
    3. make[1]: Entering directory `/mnt/record/_dev/linux/projects/cdt/wasp/src/db'
    4. g++ -c -m64 -pipe -O2 -std=c++0x -I/usr/share/qt5/mkspecs/linux-g++-64 -I. -I../dll -o ../../build/debug/db/.obj/dbal.o dbal.cpp
    5. In file included from dbal.h:9:0,
    6. from dbal.cpp:3:
    7. ../dll/Distribution.h:4:27: fatal error: QtCore/QtGlobal: No such file or directory
    8. #include <QtCore/QtGlobal>
    9. ^
    10. compilation terminated.
    To copy to clipboard, switch view to plain text mode 
    Last edited by jmalicke; 1st July 2014 at 21:51.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QtCore/QtGlobal: No such file or directory when building static archive

    Rerun qmake in the db folder.

Similar Threads

  1. Replies: 2
    Last Post: 25th July 2013, 07:17
  2. Replies: 1
    Last Post: 23rd May 2011, 05:53
  3. Replies: 1
    Last Post: 8th November 2010, 04:24
  4. Replies: 4
    Last Post: 9th May 2010, 17:18
  5. How to handle: QtCore/qconfig.h: No such file or directory ?
    By owen_263 in forum Installation and Deployment
    Replies: 2
    Last Post: 7th April 2008, 10:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.