Results 1 to 10 of 10

Thread: Adding library with .a extension

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2015
    Posts
    11
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Adding library with .a extension

    Hello Folks,

    Can any one tell me on how to add .a library in qt creator.
    My actual file name is DCCAPI.a. It is a DC Cheque Scanner. So i want to add this API definations on qt creator.
    Kindly give your valuable feedback on the same.
    Awaiting response.

    Thanks

  2. #2
    Join Date
    Aug 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Adding library with .a extension

    1) you'll need g++ compiler set up in qt creator (mingw will do the trick on windows)
    2) in your .pro file add:
    Qt Code:
    1. LIBS += -LPATH/TO/YOUR/LIB/ -llib_name
    To copy to clipboard, switch view to plain text mode 
    -L will point to directory where lib is. You can use $$PWD to point to your project directory. See path reference in Qt for other macros.
    -l will point to library name.
    3) add header reference to your sources.

    note: lib name needed, not lib FILE name. That's why you don't have to put .a

  3. #3
    Join Date
    Sep 2015
    Posts
    11
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Adding library with .a extension

    How do I fix it??

    how to add header reference to sources?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Adding library with .a extension

    Quote Originally Posted by ftl_embedded View Post
    How do I fix it??
    Easy, remove that line.

    Quote Originally Posted by ftl_embedded View Post
    how to add header reference to sources?
    Also easy: include the header or headers of the library.

    Cheers,
    _

  5. #5
    Join Date
    Sep 2015
    Posts
    11
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Adding library with .a extension

    Also,

    I have raspberry pi 2 1Gb which has arm controller. So when i try to install qt creator, it gives error of cannot execute binary file: Exec format error.
    How do i fix this error?

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Adding library with .a extension

    Quote Originally Posted by ftl_embedded View Post
    I have raspberry pi 2 1Gb which has arm controller. So when i try to install qt creator, it gives error of cannot execute binary file: Exec format error.
    How do i fix this error?
    Did you build the binary with a toolchain for ARM?
    If not, doing so will likely fix this.

    Cheers,
    _

Similar Threads

  1. How to get shared library extension in .pro
    By Gourmet in forum Qt Tools
    Replies: 0
    Last Post: 27th November 2014, 10:17
  2. adding external library
    By anh5kor in forum Qt Programming
    Replies: 1
    Last Post: 10th November 2014, 16:32
  3. adding GL utility library to Qt
    By saman_artorious in forum Qt Programming
    Replies: 0
    Last Post: 30th May 2013, 09:25
  4. Adding library in another project
    By Anshuman in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2011, 17:13
  5. Adding an external Library
    By afflictedd2 in forum Qt Programming
    Replies: 1
    Last Post: 13th December 2008, 06:51

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
  •  
Qt is a trademark of The Qt Company.