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. How to include sources like QByteArray, QtGlobal??
Forum Updated to NodeBB v4.3 + New Features

How to include sources like QByteArray, QtGlobal??

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

    Hello everyone,

    I want to ask what I need to do, do make

    #include <QByteArray>
    #include <QtDebug>
    #include <QtGlobal>
    #include <QDateTime>
    #include <QCryptographicHash>

    working.

    I get the error: "The source cannot be opened" (I translated this into english)

    I installed QT5.4, and the visual studio addin. Do I need something else?

    Cheers Steven

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Binary91
      wrote on last edited by
      #2

      Hi and welcome to DevNet!

      You have to specify the exact include paths to your compiler (the path to e.g. QByteArray.h).
      Search for the files you want to include (like QByteArray.h) on the system where Qt is installed, copy the directory path and add it to your project:
      @INCLUDEPATH += Path\To\Includes@

      If you call the compiler directly, you have to pass the include path, too. When you're using mingw, then it looks like that:
      @g++ myproject.cpp -IPath\To\Includes -o myproject.exe@

      Btw.: You don't need to include QByteArray.h to use it ;-)

      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