Results 1 to 5 of 5

Thread: Adding 3rd Party framework path in pro file

  1. #1
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Adding 3rd Party framework path in pro file

    Hi,

    I am trying to include an objective-c (on mac) based framework in my Qt based project. To do that based on the doc, I added the following lines in my pro file

    Qt Code:
    1. QMAKE_LFLAGS += -F$$PWD/FrameWorkName/FrameWorkName.framework
    2. LIBS += -framework FrameWorkName
    To copy to clipboard, switch view to plain text mode 

    But when I include the headers from this framework in my code in the following way
    Qt Code:
    1. #include <FrameWorkName/SomeHeader.h>
    To copy to clipboard, switch view to plain text mode 

    I get error saying No such file or directory.

    Also, if I place the framework in /Library/Frameworks directory use the following line in the pro file, everything works fine.
    Qt Code:
    1. LIBS += -framework FrameWorkName
    To copy to clipboard, switch view to plain text mode 

    Can some one please explain how can I include framework in my Qt project from my project path itself and not from the root?

    Thanks,
    Mithin

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Adding 3rd Party framework path in pro file

    Qt Code:
    1. includepath += ...
    To copy to clipboard, switch view to plain text mode 
    i wrote that in upper case but it keeps getting converted to lower case...

  3. #3
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding 3rd Party framework path in pro file

    I tried that too. But it doesn't work. The reason is, inside the framework's header files all the other headers are include in the following manner (there is a FrameWorkName prefix in all file included)

    Qt Code:
    1. # include <FrameWorkName/SomeHeaderFile.h>
    To copy to clipboard, switch view to plain text mode 

    and the Directory structure of the framework is
    Qt Code:
    1. /path/to/framework/Headers/HeaderFilesAreHere
    To copy to clipboard, switch view to plain text mode 

    Therefore, after including the INCLUDEPATH flag I get another File Not found error which is framework's some other header file.

    Also, how does it work correctly if I place this framework inside /Library/Frameworks/?

  4. #4
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Adding 3rd Party framework path in pro file

    when you write
    # include <FrameWorkName/SomeHeaderFile.h>
    then SomeHeaderFile.h has to be in a directory called FrameWorkName, and INCLUDEPATH should include /path/to/framework/Headers/ and the header themselves should be in /path/to/framework/Headers/FrameWorkName/*.h

  5. #5
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding 3rd Party framework path in pro file

    Quote Originally Posted by caduel View Post
    when you write
    # include <FrameWorkName/SomeHeaderFile.h>
    then SomeHeaderFile.h has to be in a directory called FrameWorkName, and INCLUDEPATH should include /path/to/framework/Headers/ and the header themselves should be in /path/to/framework/Headers/FrameWorkName/*.h
    Yes, I understand this. But when I put the framework in /Library/Frameworks/FrameWorkName.framework directory, this above conditions specified by you are not met and still code compiles correctly and that is why I am trying to find out why is this not working when I set the framework path to be something other than /Library/Frameworks/FrameWorkName.framework

    Any idea?

Similar Threads

  1. Adding a new file to moc process in XCode
    By redneon in forum Qt Programming
    Replies: 0
    Last Post: 2nd May 2009, 18:49
  2. File path issue...
    By kaushal_gaurav in forum Qt Programming
    Replies: 9
    Last Post: 1st October 2008, 15:36
  3. Text file to PDF convertion using C++ code
    By joseph in forum General Discussion
    Replies: 2
    Last Post: 21st August 2008, 01:28
  4. Problem to find file path
    By phillip_Qt in forum Qt Programming
    Replies: 14
    Last Post: 28th April 2008, 10:06
  5. Problems with korean symbols in file path
    By Raistlin in forum Qt Programming
    Replies: 5
    Last Post: 6th April 2008, 13: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.