Link error in Qt Creator with Static Build Qt5.1 Library



  • I compiled the Qt5.1 static using these command(Source files in the D:\qt51)

    1. configure -prefix E:\DevelopTools\Qt5.1_static_vc2012_64 -opensource -confirm-license -static -platform win32-msvc2012 -debug-and-release -no-icu -opengl desktop -skip qtwebkit -nomake demos -nomake examples -nomake tests -mp"
    2. nmake
    3. nmake install
      Everything goes fine but when I make a new project in the Creator,the error shows:
      ERROR:LNK1104: Cann't open file“D:\qt51\qtbase\lib\Qt5PlatformSupportd.lib”
      I think this error is caused by the MakeFile.Debug, because in the MakeFile.Debug there is a line in the LIBS "D:\qt51\qtbase\lib\Qt5PlatformSupportd.lib"

    Does anyone know how to fix it?


  • Moderators

    Don't run "install" on a prefixed build... Qt does inform you about it at the end of configure output.



  • Thank for your reply.
    I found a solution here:
    http://code.google.com/p/qt-msvc-installer/wiki/RelocationTricks
    That is:

    1. Make a qt.conf in the E:/DevelopTools/Qt5.1_static_vc2012_64 /bin
      Edit the content as below
      [Paths]
      Prefix=E:/DevelopTools/Qt5.1_static_vc2012_64
    2. Replace ALL" D:\qt51\qtbase\lib" with "E:\DevelopTools\Qt5.1_static_vc2012_64\lib" in ALL prl files
      I use UltraEdit to do this

  • Moderators

    [quote author="dnawujun" date="1373959383"]Thank for your reply.
    I found a solution here:
    http://code.google.com/p/qt-msvc-installer/wiki/RelocationTricks
    That is:

    1. Make a qt.conf in the E:/DevelopTools/Qt5.1_static_vc2012_64 /bin
      Edit the content as below
      [Paths]
      Prefix=E:/DevelopTools/Qt5.1_static_vc2012_64
    2. Replace ALL" D:\qt51\qtbase\lib" with "E:\DevelopTools\Qt5.1_static_vc2012_64\lib" in ALL prl files
      I use UltraEdit to do this[/quote]

    Did this work out??
    The path is also set in qmake and stuff. At least it was in Qt4.



  • Yes ,this solution works fine for Qt 5.1


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.