Results 1 to 8 of 8

Thread: Linking

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Linking

    Hi,
    I'm developing an application on Windows with Visual Studio and Qt 4. Now I'm trying to port the application to MinGW(using Eclipse as IDE). I have changed a lot of code that MS compiler let's do and GNU compiler don't let it.
    Now the problem is on linking step. The compiler is getting me a lot of "_imp___" errors that I think that is because the libs that I'm linking are created using MS compiler and the GNU compiler is not able to link them.

    Am I right? Is there any solution? The libs are commercial and no source code is avaiable.

    Thanks,
    Òscar Llarch i Galán

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Linking

    did you build qt for mingw?
    PS. use [b]reimp[b] tool from mingw bin utils to convert libs to libs which migw support.

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: Linking

    Hi,

    Yes, I have 2 versions of Qt. One compiled for VS and the other one compiled for MinGW.
    The "_imp__" errors refer to the 3rd party libs that I'm using, not to Qt libs.

    Thanks,
    Òscar Llarch i Galán

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Linking

    then use reimp tool for this libs for creating static libs which mingw recognize. they have *.a extension. and then link your app again with these libs.

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: Linking

    Hi,

    Thanks, I'm taking a look.
    Òscar Llarch i Galán

  6. #6
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: Linking

    Hi,

    The reimp tool have created "libOne.a" and "libOne.def". Have I to remove the "libOne.lib" file from the lib dir?
    In my PRO file I have added:
    LIBS += -L"C:\libs" -llibOne
    If I remove the "libOne.lib" file from the libs dir I'm getting this error:
    ld.exe: cannot find -llibOne

    Thanks,
    Òscar Llarch i Galán

  7. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Linking

    specify full name of a lib, i.e. ibOne.a

  8. #8
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: Linking

    Hi,

    Same error.
    Òscar Llarch i Galán

Similar Threads

  1. Static linking of Qt programs
    By divya balachandran in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2008, 12:10
  2. Linking problems with QT4 under Windows
    By Ancalagon in forum Qt Programming
    Replies: 2
    Last Post: 8th September 2008, 13:29
  3. problem with order of libs during linking
    By minimax in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2008, 10:32
  4. Linking myLib with myApp
    By vermarajeev in forum Qt Programming
    Replies: 11
    Last Post: 20th February 2007, 13:51
  5. Replies: 4
    Last Post: 20th February 2006, 09:11

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.