Results 1 to 4 of 4

Thread: QT and SPI on Raspberry PI (include files problem)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2018
    Posts
    3
    Qt products
    Qt5

    Default Re: QT and SPI on Raspberry PI (include files problem)

    Quote Originally Posted by high_flyer View Post
    Your problem does not seem to be an issue with SPI but with your STL includes.
    Try using the form:
    Qt Code:
    1. //#include <stdint.h>
    2. //#include <unistd.h>
    3. //#include <stdio.h>
    4. //#include <stdlib.h>
    5. //#include <getopt.h>
    6. //#include <fcntl.h>
    7.  
    8. #include <stdint>
    9. #include <unistd>
    10. #include <stdio>
    11. #include <stdlib>
    12. #include <getopt>
    13. #include <fcntl>
    To copy to clipboard, switch view to plain text mode 

    And see if it helps.

    Thank you for your reply.

    I have tried your solution but then I have got following error:

    Qt Code:
    1. In file included from ../MyApp/main.cpp:1:0:
    2. stdint: No such file or directory
    To copy to clipboard, switch view to plain text mode 

    I agree that the problem is with including standard headers but I do not know how to resolve this issue.

    Did I correctly write line in .pro file?
    Qt Code:
    1. INCLUDEPATH+=/usr/include
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jul 2018
    Posts
    3
    Qt products
    Qt5

    Default Re: QT and SPI on Raspberry PI (include files problem)

    I have solved the problem with STL includes.

    The INCLUDEPATH+=/usr/include line should be removed, but this path should be added to Tools->Options->C++->File Naming->Search Paths (add /usr/include).

    For SPI header linux/ioctl.h must be changed to sys/ioctl.h like in original spidev_test.c.

    After this modification I successfully tested SPI but now I am facing other problems with it. I can not call close() function and I can not change spidev1.0 mode to 1. I know that this is not a topic for this forum, so I will ask it somewhere elese but if someone has any ideas about my problem, please write.

    Best regards.

Similar Threads

  1. Replies: 5
    Last Post: 30th October 2012, 08:52
  2. Problem in Qt3D include files
    By lni in forum Qt Programming
    Replies: 0
    Last Post: 17th August 2011, 13:05
  3. Combining include files
    By marcvanriet in forum General Programming
    Replies: 12
    Last Post: 17th October 2010, 09:55
  4. qmake: include files?
    By Doug Broadwell in forum Newbie
    Replies: 2
    Last Post: 16th May 2007, 23:34
  5. problem with include files
    By JR in forum General Discussion
    Replies: 2
    Last Post: 22nd December 2006, 20:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.