Results 1 to 7 of 7

Thread: how to use .lib file in Qt in Linux

  1. #1
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default how to use .lib file in Qt in Linux

    I have a .lib file but i don't know to use this file in Linux In windows i used it by LIBS += mylib.lib in .pro file
    please help me
    thanks

  2. #2
    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: how to use .lib file in Qt in Linux

    Library files on Linux are typically libsomething.a (static) or libsomething.so (dynamic) not something.lib. You access library files the same way on Linux as you do on Windows. However, the name conventions are different:
    Qt Code:
    1. LIBS += -L/path/to/search -lsomething
    To copy to clipboard, switch view to plain text mode 
    Is the .lib file from a Windows library? If so, then it isn't useable under Linux.

  3. #3
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to use .lib file in Qt in Linux

    Quote Originally Posted by ChrisW67 View Post
    Library files on Linux are typically libsomething.a (static) or libsomething.so (dynamic) not something.lib. You access library files the same way on Linux as you do on Windows. However, the name conventions are different:
    Qt Code:
    1. LIBS += -L/path/to/search -lsomething
    To copy to clipboard, switch view to plain text mode 
    Is the .lib file from a Windows library? If so, then it isn't useable under Linux.
    thanks
    I copied the .lib file from windows into linx
    But i tried as you guiding but it don't run. I will try again, and report to 4rum after
    thanks agian

  4. #4
    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: how to use .lib file in Qt in Linux

    Is the .lib file from a Windows library? If so, then it isn't useable under Linux.

    You will need to find/build the library in the Linux environment.

  5. #5
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to use .lib file in Qt in Linux

    thanks for answer
    this is my LIBS += -L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib -llibxvidcore it still don't run in the L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib I have 4 files
    libxvidcore.a
    libxvidcore.so
    libxvidcore.so.4
    libxvidcore.so.4.2
    \thaks

  6. #6
    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: how to use .lib file in Qt in Linux

    The lib part of the library file name is implied. You also need to quote the space in the path.
    Qt Code:
    1. LIBS += $$quote(-L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib) -lxvidcore
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to use .lib file in Qt in Linux

    Quote Originally Posted by ChrisW67 View Post
    The lib part of the library file name is implied. You also need to quote the space in the path.
    Qt Code:
    1. LIBS += $$quote(-L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib) -lxvidcore
    To copy to clipboard, switch view to plain text mode 
    i removed space but it still does not run

Similar Threads

  1. Replies: 4
    Last Post: 11th March 2010, 13:52
  2. How can we get file version information in Linux?
    By payal in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2010, 15:46
  3. Replies: 0
    Last Post: 10th February 2010, 07:07
  4. GLC_lib in pro file LINUX
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2009, 07:14
  5. Access MS .mdb file on Linux
    By iGoo in forum Qt Programming
    Replies: 3
    Last Post: 15th June 2006, 09:42

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.