Results 1 to 6 of 6

Thread: How to define a string marco in pro file

  1. #1
    Join Date
    Mar 2009
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question How to define a string marco in pro file

    In qt-extended-4.4.2, I wan to define a marco for a string in pro file. like this:
    DEFINES += SHARE_DIR=\"/usr/local/share/kphone\"

    But it error in compilation.
    If you kown why or how to do, please reply. Thank you very much!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to define a string marco in pro file

    Try:
    qmake Code:
    1. DEFINES+="SHARE_DIR=/usr/local/share/kphone"
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Exclamation DEFINES += "SHARE_DIR=/usr/local/share/kphone" error

    expected primary-expression before '/' token
    'usr' was not declared in this scope
    'local' was not declared in this scope
    'share' was not declared in this scope
    'kphone' was not declared in this scope
    unused variable 'usr'
    unused variable 'local'
    unused variable 'share'
    unused variable 'kphone'

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to define a string marco in pro file

    Does
    qmake Code:
    1. DEFINES += SHARE_DIR=\\\"/usr/local/share/kphone\\\"
    To copy to clipboard, switch view to plain text mode 
    do what you want?
    J-P Nurmi

  5. #5
    Join Date
    Mar 2009
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Smile SHARE_DIR=\\\"/usr/local/share/kphone\\\" OK

    Thank you.
    It is the kphone source, I'm porting to Qt-Extended 4.4.2, The pro file need a Marco for define a filepath.

  6. #6
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to define a string marco in pro file

    For windows build don't forget to comment special chars like &|() with ^ http://www.microsoft.com/resources/d....mspx?mfr=true
    This chars has higer priority then "" on windows.

Similar Threads

  1. odd double widgets
    By jhearon in forum Qt Programming
    Replies: 1
    Last Post: 23rd February 2008, 18:18
  2. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. How to search a string in xml file with Qt Dom classes
    By doganay44 in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2006, 20:16

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