Results 1 to 8 of 8

Thread: Add hpp file to qt project

  1. #1
    Join Date
    Jun 2010
    Posts
    100
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Add hpp file to qt project

    Hi all!

    I need to include a hpp file and use a ".so" with the QLibrary class. I have some experience with the QLibrary class but I can't #include the hpp file as it show on the documentation of the product. It gives me almost 500 errors on external files and I can't find a solution. Probably I just have to change something in my pro file..

    The files are attached to this thread.

    thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Add hpp file to qt project

    It would be nice to see the first error you got.

  3. #3
    Join Date
    Jun 2010
    Posts
    100
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Add hpp file to qt project

    on the documentation says to include the file bgapi.hpp. When I do that I get the following errors 440 times:

    expected constructor, destructor, or type conversion before ‘(’ token Baumer_Capture_Test line 100, external location: /esp/BaumerDrivers/include/bgapi.h C/C++ Problem
    expected `)' before ‘*’ token Baumer_Capture_Test line 101, external location: /esp/BaumerDrivers/include/bgapi.hpp C/C++ Problem

    There are some other errors but all in those external files (bgapi.hpp and bgapi.h)

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Add hpp file to qt project

    You didn't include all the necessary files.

    Baumer_Capture_Test is nowhere defined in the files you posted.

  5. #5
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Add hpp file to qt project

    I'm not sure, but you might need to set QMAKE_EXT_H variable. More is here.
    I'm a rebel in the S.D.G.

  6. #6
    Join Date
    Jun 2010
    Posts
    100
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Add hpp file to qt project

    Baumer_Capture_Test is the name of my Qt project. I just attached the files I am having troubles including.

  7. #7
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add hpp file to qt project

    Ruben,

    Did you solve this problem? I am faced with it also.

    Thanks,
    Steve

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Add hpp file to qt project

    The third party header files assume the _GNULINUX symbol is defined on Linux boxes. I don't have access to the documentation for the library but I would be surprised if this is not in the shipped documentation. All the OP needs to do is add:
    Qt Code:
    1. DEFINES += _GNULINUX
    To copy to clipboard, switch view to plain text mode 
    to the project PRO file to get past these compile errors. Link errors, which I'm sure are the next question, are fixed by getting LIBS right.

Similar Threads

  1. Replies: 3
    Last Post: 3rd August 2010, 13:12
  2. help creating a project file
    By Slewman in forum Qt Programming
    Replies: 10
    Last Post: 23rd December 2009, 11:42
  3. Replies: 1
    Last Post: 3rd December 2009, 23:34
  4. how can i run a project from only a .ui file in qt4
    By iamjayanth in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2008, 01:36
  5. .h file for each form in QT 3.3.5 project??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2006, 11:59

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.