Results 1 to 6 of 6

Thread: Add platform dependent path into pro file problem

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Add platform dependent path into pro file problem

    Hi,
    I've created simple project and i want to add a library to my project and i want to add its path base on my platform so i did this in my pro file:
    Qt Code:
    1. win32
    2. {
    3. INCLUDEPATH += C:\Qwt-6.0.2\include
    4. LIBS += -LC:\Qwt-6.0.2\lib -lqwt
    5.  
    6. CONFIG += qwt
    7. }
    To copy to clipboard, switch view to plain text mode 

    but i get " error: Parse Error ('win32')" . When i remove win32 it works fine. any suggestion?

  2. #2
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Add platform dependent path into pro file problem

    try this form

    Qt Code:
    1. win32 {
    2. INCLUDEPATH += C:\Qwt-6.0.2\include
    3. LIBS += -LC:\Qwt-6.0.2\lib -lqwt
    4.  
    5. CONFIG += qwt
    6. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Add platform dependent path into pro file problem

    What's its difference with my code!!!???

  4. #4
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Add platform dependent path into pro file problem

    open the brace in front of win32, line two of your code is in line one in the second code



    Added after 9 minutes:


    take a look at this http://doc.qt.io/qt-4.8/qmake-project-files.html,
    The opening brace must stand on the same line as the condition
    Last edited by Ashkan_s; 6th October 2012 at 10:37.

  5. The following user says thank you to Ashkan_s for this useful post:

    alizadeh91 (6th October 2012)

  6. #5
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Add platform dependent path into pro file problem

    :| !!! That's worked!!!

  7. #6
    Join Date
    Oct 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Add platform dependent path into pro file problem

    Quote Originally Posted by alizadeh91 View Post
    :| !!! That's worked!!!
    You better use forward slashes anyway.

Similar Threads

  1. Replies: 1
    Last Post: 10th March 2011, 15:37
  2. Path problem for Symbian native lib files, when referenced in QT pro file
    By farooqmian in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 10th February 2011, 13:32
  3. Replies: 3
    Last Post: 18th January 2010, 10:35
  4. Problem to find file path
    By phillip_Qt in forum Qt Programming
    Replies: 14
    Last Post: 28th April 2008, 10:06
  5. Platform dependent source files: what is best?
    By ucomesdag in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2006, 18:52

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.