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



  • @
    #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]



  • @
    #include <QString.h>
    @

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

    @
    #include <QString>
    @


  • Lifetime Qt Champion

    Hi,

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

    @#include <QtClassName>@



  • 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 ?


  • Lifetime Qt Champion

    Can you post the content of your pro file ?




  • Lifetime Qt Champion

    That's one exotic setup you have there.

    Are you sure all include paths are setup correctly ?



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.