Results 1 to 7 of 7

Thread: LIBS+= behaviour on Windows

  1. #1
    Join Date
    Jul 2008
    Posts
    27
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default LIBS+= behaviour on Windows

    This must be a very newbie question ,but I m both confused and frustrated ,I have looked around for a while (escuse me if somewhere else there is a right answer forr my question) and didnt find an explanation .
    It s simple : I want to add more library paths and more libraries to my makefile .What should I put after LIBS+= ? Well ,that sounds I little bit stupid . I mean : http://doc.trolltech.com/4.4/qmake-v...ence.html#libs
    should I add full paths to libraries ? If I do that ,the makefile generated looks like this : (just the interesting part)

    Qt Code:
    1. -L"i:\Qt\4.4.0\lib" -lmingw32 -lqtmaind I:\MinGW\lib\libaclui.a -lQt3Supportd4 -lQtGuid4 -lQtCored4
    To copy to clipboard, switch view to plain text mode 

    If I do LIBS+= -L" I:\MinGW\lib\" (just to add a path) :

    Qt Code:
    1. -L"i:\Qt\4.4.0\lib" -lmingw32 -lqtmaind -LI:\MinGW\lib -lQt3Supportd4 -lQtGuid4 -lQtCored4
    To copy to clipboard, switch view to plain text mode 

    Is that correct? Shouldnt it add " at the begin and end of the path? Can the path have spaces?This way it seems to work ,but it s not the way the documentation says it should be ,is it?
    Ok ,lets sum up : I someone can tell mee the syntax of LIBS+= in .pro on windows I would really ,really apreciate it.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: LIBS+= behaviour on Windows

    Quote Originally Posted by Benne Gesserit View Post
    This way it seems to work ,but it s not the way the documentation says it should be ,is it?
    Where does it say so?

    You can use the Unix -l (library) and -L (library path) flags and qmake will do the correct thing with these libraries on Windows (namely this means passing the full path of the library to the linker).

  3. The following user says thank you to jacek for this useful post:

    Benne Gesserit (4th August 2008)

  4. #3
    Join Date
    Jul 2008
    Posts
    27
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: LIBS+= behaviour on Windows

    Ok ,maybe I misunderstood the documentation .
    But ,then ,is it fine if in the makefile qmake puts -Lpath instead of -L"path" ? And can the path have spaces? Probably I will be testing that tomorrow ,but just to make it clear and in case anyone finds the same doubts .
    If God has friends ,then I cant be God.

  5. #4
    Join Date
    Jul 2008
    Posts
    27
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: LIBS+= behaviour on Windows

    Ok ,I think I got my answers .I have just been working with libpaths with spaces and I think the conclusion is : when you want to add a libpath with a space ,you ve got to do it like : -L "path" .
    Note the space between the 'L' and the first " .Otherwise ,I think qmake will have problems with the " (placing them somewhere else or just erasing them) or with the spaces in the path .
    Hope this helps someone else and saves some time .Maybe I am the only fool who has to spend some time wondering how to do such a thing .
    If God has friends ,then I cant be God.

  6. #5
    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: LIBS+= behaviour on Windows

    "-Lpath with spaces" (with -L inside the quotes) would have also worked, I think.

  7. The following user says thank you to wysota for this useful post:

    Benne Gesserit (4th August 2008)

  8. #6
    Join Date
    Jul 2008
    Posts
    27
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: LIBS+= behaviour on Windows

    Yes ,you are right .At least it seems to work .But....I dont like it .It s confusing ,you always see -L"path" ,then you see "-Lpath"....seems to be a mistake .Anyway ,it s good to know it can be used that way,
    Thank you very much.
    If God has friends ,then I cant be God.

  9. #7
    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: LIBS+= behaviour on Windows

    No, "-Lpath" is correct because quotes surround the whole argument and that's the meaning of quotes - to build a parameter containing spaces you surround it with quotes, not that you surround spaces with quotes or surround parts of the argument containing spaces with quotes.

Similar Threads

  1. Qt + Eclipse + MinGW + Windows: How to include libraries?
    By jambrek in forum General Programming
    Replies: 3
    Last Post: 19th December 2007, 13:57
  2. Windows not appearing in XP.
    By beardybloke in forum Qt Programming
    Replies: 7
    Last Post: 24th October 2007, 17:32
  3. Including libs on windows
    By ucomesdag in forum Qt Programming
    Replies: 2
    Last Post: 17th August 2007, 08:31
  4. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 01:00
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

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.