Results 1 to 8 of 8

Thread: linker error when installing 4.7.1

  1. #1
    Join Date
    Nov 2010
    Location
    Houston, Texas, USA
    Posts
    30
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default linker error when installing 4.7.1

    Hi all,

    I am attempting to reinstall Qt 4.7.1 (commercial license) on Win 7 (64bit). I am encountering "unresolved externals" during the build.

    The original installation was on C:, but for diskspace reasons I decided to install on another drive "J:".

    Here is the description of where I am at, what I did, etc.

    I have msvc2008 Express installed.

    Based on some advice I encountered while googling I installed Activestate's Perl.

    I have rebooted to ensure that all changes to environmental variables are in effect. Issuing the SET command at the prompt shows that J:\Qt\4.7.1\bin; is in the path.

    I desire to have various shadow build directories for the SDK. The current installation is in J:\Qt\4.7.1 The shadow directory I am trying to build is J:\Qt\4.7.1-rel-dll

    I am running configure from J :\Qt\4.7.1-rel-dll

    When I run configure I issue the following command

    ..\4.7.1\configure -release -shared -prefix J:/Qt/4.7.1/release -platform win32-msvc2008
    Configure seems to run uneventfully. When configure completes I run nmake.

    nmake runs for awhile and then terminates with

    ..\..\lib\QtNetwork4.dll : fatal error LNK1120: 31 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"' : return code '0x460'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    BUT, when I issue find /cygdrive/j/Qt -iname "*QtNetwork4.*" from the cygwin prompt I get:
    $ find /cygdrive/j/Qt -iname "*QtNetwork4.*"
    /cygdrive/j/Qt/4.7.1/bin/QtNetwork4.dll
    /cygdrive/j/Qt/4.7.1/lib/QtNetwork4.lib
    /cygdrive/j/Qt/4.7.1-rel-dll/lib/QtNetwork4.exp
    /cygdrive/j/Qt/4.7.1-rel-dll/lib/QtNetwork4.lib <------ huh? I asked for a DLL, not a lib
    /cygdrive/j/Qt/qtcreator-2.0.1/bin/QtNetwork4.dll
    For some reason, I find QtNetwork4.lib instead of QtNetwork4.dll
    Not what I expected. Maybe QtNetwork4.lib is an intermediate file and not the final work product.


    Looking through the messages, I see trouble beginning after the linker begins creating QtNetwork4.lib

    Qt Code:
    1. moc_qtcpsocket.cpp
    2. moc_qudpsocket.cpp
    3. link /LIBPATH:"j :\Qt\4.7.1-rel-dll\lib" /LIBPATH:"j:\Qt\4.7.1-rel-dll\lib" /NOLOGO /BASE:0x64000000 /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:"tmp\obj\release_shared\QtNetwork.intermediate.manifest" /VERSION:4.71 /OUT:..\..\lib\QtNetwork4.dll @C:\Users\A\AppData\Local\Temp\nm4A5E.tmp
    4. Creating library ..\..\lib\QtNetwork4.lib and object ..\..\lib\QtNetwork4.exp
    5. qnetworkreplyimpl.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    6. qabstractsocket.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    7. moc_qhttpnetworkreply_p.obj : error LNK2019: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z) referenced in function "public: void __thiscall QSslSocket::`default constructor closure'(void)" (??_F
    8. QSslSocket@@QAEXXZ)
    9. moc_qnetworkaccesshttpbackend_p.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    10. qnetworkaccessmanager.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    11. qnetworkaccesshttpbackend.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    12. qnetworkrequest.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    13. qnetworkreply.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    14. qhttp.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    15. qhttpnetworkreply.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    16. qhttpnetworkconnection.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    17. qhttpnetworkconnectionchannel.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
    18. qnetworkreplyimpl.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    19. qabstractsocket.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    20. moc_qhttpnetworkreply_p.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    21. moc_qnetworkaccesshttpbackend_p.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    22. qnetworkaccessmanager.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    23. qnetworkaccesshttpbackend.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    24. qnetworkrequest.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    25. qnetworkreply.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    26. qhttp.obj : error LNK2019: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z) referenced in function "public: void __thiscall QSslCertificate::`default
    27. constructor closure'(void)" (??_FQSslCertificate@@QAEXXZ)
    28. qhttpnetworkreply.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    29. qhttpnetworkconnection.obj : error LNK2001: unresolved external symbol "public: __thiscall QSslCertificate::QSslCertificate(class QByteArray const &,enum QSsl::EncodingFormat)" (??0QSslCertificate@@QAE@ABVQByteArray@@W4EncodingFormat@QSsl@@@Z)
    To copy to clipboard, switch view to plain text mode 

    It is a mystery to me why I am encountering this error. Does anyone have a suggestion/recommendation?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: linker error when installing 4.7.1

    <------ huh? I asked for a DLL, not a lib
    No you didn't:
    when I issue find /cygdrive/j/Qt -iname "*QtNetwork4.*"
    You asked for any file that contains "QtNetowrk4" in its name.
    For some reason, I find QtNetwork4.lib instead of QtNetwork4.dll
    No, you found both:
    /cygdrive/j/Qt/4.7.1/bin/QtNetwork4.dll
    and
    /cygdrive/j/Qt/4.7.1-rel-dll/lib/QtNetwork4.lib
    and once more:
    /cygdrive/j/Qt/qtcreator-2.0.1/bin/QtNetwork4.dll
    Maybe QtNetwork4.lib is an intermediate file and not the final work product.
    No, the lib file contains the symbols for the dll - your linker needs it when you link to this QtNetwork4.dll.
    J:\Qt\4.7.1\bin; is in the path.
    Do you have a correct QTDIR in your path?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Nov 2010
    Location
    Houston, Texas, USA
    Posts
    30
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: linker error when installing 4.7.1

    Hey, High Flyer,

    First of all, thank you for responding.

    regarding:
    <------ huh? I asked for a DLL, not a lib
    No you didn't:
    I meant that when I issued the command
    ..\4.7.1\configure -release -shared -prefix J:/Qt/4.7.1/release -platform win32-msvc2008
    was saying that I expected the build to generate a .DLL instead of a .LIB because I specified building shareable libraries. Of course I understood that the parameters given to the 'find' command would return any file or directory with "QtNetowrk4" in its name.

    Regarding:
    J:\Qt\4.7.1\bin; is in the path.
    Do you have a correct QTDIR in your path?
    Yes, I installed into J:\Qt\4.7.1

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: linker error when installing 4.7.1

    was saying that I expected the build to generate a .DLL instead of a .LIB because I specified building shareable libraries.
    As I said, the *.lib holds the symbols to your DLL.
    You need both, the DLL (for runtime) and the *.lib for build time (linking).

    Yes, I installed into J:\Qt\4.7.1
    But what is your QTDIR environment variable value?
    It needs to be set to J:\Qt\4.7.1.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. The following user says thank you to high_flyer for this useful post:

    ajax (22nd February 2011)

  6. #5
    Join Date
    Nov 2010
    Location
    Houston, Texas, USA
    Posts
    30
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: linker error when installing 4.7.1

    As I said, the *.lib holds the symbols to your DLL.
    You need both, the DLL (for runtime) and the *.lib for build time (linking).
    Ah! That is new information for me. Sorry I made it necessary for you to tell me that twice.

    But what is your QTDIR environment variable value?
    It needs to be set to J:\Qt\4.7.1.
    I don't have one, but I'm adding one right now. I will report back regarding the outcome.

    Many thanks for your advice


    Added after 5 minutes:


    As I said, the *.lib holds the symbols to your DLL.
    You need both, the DLL (for runtime) and the *.lib for build time (linking).
    Ah! That is new information for me. Sorry I made it necessary for you to tell me that twice.

    But what is your QTDIR environment variable value?
    It needs to be set to J:\Qt\4.7.1.
    I don't have one, but I'm adding one right now. I will report back regarding the outcome.

    Many thanks for your advice


    Added after 1 18 minutes:


    OK, I now have different symptoms.

    First of all, I added the QTPATH environmental variable
    QTPATH=J:\Qt\4.7.1
    The symptoms have shifted from a linker error to an inability to find a moc.
    qtextstream.cpp
    j:\Qt\4.7.1\src\corelib\io\qtextstream.cpp(3397) : fatal error C1083: Cannot open include file: 'qtextstream.moc': No such file or directory
    qtemporaryfile.cpp
    and
    qsettings_win.cpp
    qprocess_win.cpp
    j:\Qt\4.7.1\src\corelib\io\qfilesystemwatcher.cpp( 636) : fatal error C1083: Cannot open include file: 'qfilesystemwatcher.moc': No such file or directory
    qfsfileengine_win.cpp

    I am attempting to build in a shadow dir named
    J:\Qt\4.7.1-rel-dll
    To get these symptoms I issued the command
    J:\Qt\4.7.1-rel-dll>..\4.7.1\configure -prefix c:/Qt/4.7.1-rel-dll
    I get the same outcome if I issue:
    J:\Qt\4.7.1-rel-dll>..\4.7.1\configure
    Last edited by ajax; 22nd February 2011 at 18:32.

  7. #6
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: linker error when installing 4.7.1

    I got the same problem re moc on a Linux platform. In my case, moving moc from its qt subdirectory to ~/bin solved the problem. You might try moving moc into QTPATH.

    Matt

  8. #7
    Join Date
    Nov 2010
    Location
    Houston, Texas, USA
    Posts
    30
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: linker error when installing 4.7.1

    Thank you for your advice, Matt.

    Well, It looks to me like the moc is in the QTPATH. I issued the following command from the cygwin prompt:

    $ find /cygdrive/j/Qt -iname "moc.exe"
    /cygdrive/j/Qt/4.7.1/bin/moc.exe
    and the QTPATH environmental variable is:

    $ env | grep QTPATH
    QTPATH=J:\Qt\4.7.1
    And the path variable contains "J:\Qt\4.7.1\bin;"

    So, as far as I can tell, the moc is in the QTPATH.

    More info. I executed configure (with no options) in J:\Qt\4.7.1 and then nmake. As of this writing the build is continuing nicely and has been grinding away for much longer than the previous attempts. It might be premature, but I think it's going to work this time.

    If so, then I have the case where I can conduct a build from within J:\Qt\4.7.1 but not from within J:\Qt\4.7.1-rel-dll . This is pointing to a procedure error on my part, but it is not clear to me what I am doing wrong.

    The first post in this thread shows the commands I issued and the directory where I issued these commands. The only difference between then and now is that I have the QTPATH environmental variable defined. I do not understand why my attempt to build a shadow directory is failing.


    Added after 52 minutes:


    I knew I shouldn't have predicted success before the fact.

    The build failed after running a pretty long time.
    cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -MP -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_EDITION=QT_EDITION_DESKTOP -DQT_DLL -DQT_NO_DEBUG -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SS
    2 -DQT_THREAD_SUPPORT -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include\QtMultimedia" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-msvc2008" -Fotmp\obj\release_shared\ @C:\Users\A\AppData\Local\Temp\nmFC34.tmp
    oc_audiooutput.cpp
    link /LIBPATH:"j:\Qt\4.7.1\lib" /LIBPATH:"j:\Qt\4.7.1\lib" /NOLOGO /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:"tmp\obj\release_shared\audiooutput.i ntermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken
    '6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:release\audiooutput.exe @C:\Users\A\AppData\Local\Temp\nmB7.tmp
    mt.exe -nologo -manifest "tmp\obj\release_shared\audiooutput.intermediate.m anifest" -outputresource:release\audiooutput.exe;1
    MAKE : fatal error U1077: '"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe"' : return code '0x1f'
    top.
    According to the post http://www.qtcentre.org/archive/index.php/t-9776.html norton antivirus can (rarely) cause this symptom by attacking a newly generated obj. It just so happens that I had norton disabled and it automatically resumed around the time the build failed.

    Disabling Norton AV for another five hours are restarting the build. (mumbling vile curses under my breath)
    Last edited by ajax; 23rd February 2011 at 00:47.

  9. #8
    Join Date
    Nov 2010
    Location
    Houston, Texas, USA
    Posts
    30
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: linker error when installing 4.7.1

    Another update. The build run from within J:\Qt\4.7.1 succeeded.

    Now I need to figure out how to build a shadow directory at j:\Qt\4.7.1-rel-dll

Similar Threads

  1. Linker error in windows
    By Valheru in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2008, 23:19
  2. Linker error
    By Tavit in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2008, 15:30
  3. Vtable linker error
    By jhearon in forum Qt Programming
    Replies: 3
    Last Post: 22nd July 2007, 18:31
  4. Linker error
    By alfblt16 in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2006, 10:20
  5. Linker Error
    By ankurjain in forum Qt Programming
    Replies: 2
    Last Post: 5th April 2006, 06:45

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.