Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

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

    Installation and Deployment
    3
    8
    10661
    Loading More Posts
    • 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
      chet last edited by

      @
      #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 Reply Quote 0
      • A
        andreyc last edited by

        @
        #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 Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          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 Reply Quote 0
          • C
            chet last edited by

            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 Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              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 Reply Quote 0
              • C
                chet last edited by

                HI here my proj files

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

                1 Reply Last reply Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  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 Reply Quote 0
                  • A
                    andreyc last edited by

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

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post