Results 1 to 8 of 8

Thread: Linking a .a and .dll library to Qt project

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Posts
    31
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Linking a .a and .dll library to Qt project

    Hi sir, currently I have tried this method:


    ..I am currently using mingw compiler, so the library file format generated is a '.a' and '.dll' format.

    I added the library using 'add internal library'. This generated the code in my .pro file.

    unix:!symbian|win32: LIBS += -L$$OUT_PWD/../../../BiTCommon/Template/Project/ -lTemplate

    INCLUDEPATH += $$PWD/../../../BiTCommon/Template/Include
    DEPENDPATH += $$PWD/../../../BiTCommon/Template/Include


    ..upon building the project, it gives me this error.
    'cannot find -lTemplate'


    ..Next I tried to change the -lTemplate to -aTemplate since the library generated was in a '.a' format. Upon building there were no errors but when I instantiated the class it gave me this error.


    error: undefined reference to `_imp___ZN19CTemplateMainWindowC1EP7QWidget'



    ..any inputs would really be helpful. To cut the long story short, I was previously compiling in msvc and it generated .lib files and I just link it to my project. Now that it is in mingw, it generates a different file format.

  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: Linking a .a and .dll library to Qt project

    You are telling Qt that there is a library called "libTemplate.a" in a folder "$$OUT_PWD/../../../BiTCommon/Template/Project/" (wherever that resolves to) or elsewhere on the standard path. I guess it is not there.

Similar Threads

  1. Linking DLL to Project
    By lynchkp in forum Newbie
    Replies: 4
    Last Post: 29th January 2012, 05:36
  2. Problem linking against library
    By PowerPlate in forum Qt Programming
    Replies: 3
    Last Post: 15th October 2011, 02:45
  3. linking .so library in Qt on Mac Platform.
    By syclopse in forum Qt Programming
    Replies: 0
    Last Post: 18th August 2011, 10:50
  4. Help needed linking to library
    By StephenR in forum Qt Programming
    Replies: 4
    Last Post: 3rd July 2009, 08:50
  5. linking qt3 to a library
    By thebra in forum Newbie
    Replies: 10
    Last Post: 11th November 2006, 01:25

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.