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. QtCore/QtGlobal: No such file or directory when building static archive

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.1k 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.
  • J Offline
    J Offline
    jmalicke
    wrote on last edited by
    #1

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

    @src/
    db/
    dbal.h
    dbal.pro
    dll/
    Distribution.h
    dll.pro
    project.pro@

    db is static and dll is shared

    Distribution.h

    @#ifndef DISTRIBUTION_H_
    #define DISTRIBUTION_H_

    #include <QtCore/QtGlobal>

    #if defined(BUILDING_DLL)
    #define DLL_FUNCTION Q_DECL_EXPORT
    #else
    #define DLL_FUNCTION Q_DECL_IMPORT
    #endif

    #endif /* DISTRIBUTION_H_ */@

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

    dbal.h

    @#ifndef DBAL_H_
    #define DBAL_H_

    #include "Distribution.h"

    ...

    #endif@

    db.pro

    @TARGET = db
    TEMPLATE = lib
    CONFIG = staticlib c++11

    QT += core

    INCLUDEPATH += ../dll

    HEADERS += dbal.h
    HEADERS += dbal_sqlite.h

    SOURCES += dbal.cpp
    SOURCES += dbal_sqlite.cpp

    ######################################################################

    Build to custom directories

    ######################################################################

    DESTDIR = ../../build/debug/db

    OBJECTS_DIR = $$DESTDIR/.obj
    MOC_DIR = $$DESTDIR/.moc
    RCC_DIR = $$DESTDIR/.qrc
    UI_DIR = $$DESTDIR/.ui@

    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:

    @make all
    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
    make[1]: Entering directory `/mnt/record/_dev/linux/projects/cdt/wasp/src/db'
    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
    In file included from dbal.h:9:0,
    from dbal.cpp:3:
    ../dll/Distribution.h:4:27: fatal error: QtCore/QtGlobal: No such file or directory
    #include <QtCore/QtGlobal>
    ^
    compilation terminated.@

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      What is the content of your db/dll.pro file? It looks like qmake wasn't run properly and didn't build the makefile with the Qt stuff.

      So you are correct there are missing -I and -L from the make.

      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