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. Rect.cpp:3:19: fatal error: QString: No such file or directory

Rect.cpp:3:19: fatal error: QString: No such file or directory

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 3 Posters 12.0k Views
  • 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.
  • C Offline
    C Offline
    chet
    wrote on last edited by
    #1

    @
    #include "dijsdk.h"
    #include <iostream>
    #include <QString.h>
    #include "arraysize.h"
    #include "Rect.h"

    Rectangle::Rectangle()
    {

    }

    Rectangle::~Rectangle()
    {

    }

    int Rectangle::FindCameras()
    {
    QString m_guids[16];
    DijSDK_CamGuid guids[ARRAYSIZE(m_guids)] = {0};
    unsigned int numGuids = ARRAYSIZE(guids);
    int result;
    int index;
    int res = DijSDK_Init();
    result = DijSDK_FindCameras(guids, &numGuids);

    std::cout<<"\nNumGuids = "<<numGuids;

    std::cout<<"\nresult = "<<result;

    if(result == 0)
    result1 = DijSDK_FindCameras(guids, &numGuids); //API call

    std::cout<<"\nNumguids = " <<numGuids;
    std::cout<<"\nResult = "<<result1;
    std::cout<<"\nGuids = "<<guids[0];

    return 0;
    }
    @

    this is .py file
    @
    from distutils.core import setup
    from distutils.extension import Extension
    from Cython.Distutils import build_ext

    setup(ext_modules=[Extension("rectangle", ["rect.pyx", "Rect.cpp"], language="c++",)],
    include_dirs=["/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include /qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4"],
    cmdclass = {'build_ext': build_ext})
    @

    after that I am using command in linux
    @
    user@emb-ubu-085:~/Desktop/reports$ sudo python setup.py build_ext --inplace -I/usr /include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.
    running build_ext
    cythoning rect.pyx to rect.cpp
    building 'rectangle' extension
    i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/include/python2.7 -c rect.cpp -o build/temp.linux-i686-2.7/rect.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
    i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/include/python2.7 -c Rect.cpp -o build/temp.linux- i686-2.7/Rect.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
    Rect.cpp:3:19: fatal error: QString.h: No such file or directory
    compilation terminated.
    error: command 'i686-linux-gnu-gcc' failed with exit status 1
    @

    [edit: i added @ tags to your code. Please do so next time, Eddy]

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

      @
      #include <QString.h>
      @

      I don't have Qt4 installed and don't remember exactly but I think it should be

      @
      #include <QString>
      @

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

        Hi,

        andreyc is right, don't post-fix Qt's include, it's just

        @#include <QtClassName>@

        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
        • C Offline
          C Offline
          chet
          wrote on last edited by
          #4

          i changed to QString but still Rect.cpp:3:19: fatal error: QString: No such file or directory

          is iam missing any libraries some where ?

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

            Can you post the content of your pro file ?

            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
            • C Offline
              C Offline
              chet
              wrote on last edited by
              #6

              HI here my proj files

              http://stackoverflow.com/questions/22934099/rect-cpp319-fatal-error-qstring-no-such-file-or-directory

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

                That's one exotic setup you have there.

                Are you sure all include paths are setup correctly ?

                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
                  andreyc
                  wrote on last edited by
                  #8

                  To verify that you have paths included try to find QString in your filesystem.
                  @
                  locate QString
                  or
                  find / -name 'QString*'
                  @

                  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