Results 1 to 11 of 11

Thread: Unresolved external symbol while building Installer Framework

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2025
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Exclamation Unresolved external symbol while building Installer Framework

    Hi!

    Currently I'm trying to build sources of IF with dynamically linked QT.
    OS: win 10
    QT - branches ifw-5.15.2, 5.15.6-lts-lgpl,... (tried different)
    IF - branch 4.3
    compiler: msvc, tried compilers from different Visual Studios: 2015, 2017, 2019

    That's how I build dynamic QT
    Qt Code:
    1. call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 10.0.17763.0
    2. SET _ROOT=D:\tfgit\qt\qt_test3\qt5
    3. SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
    4. SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
    5. SET _ROOT=
    6.  
    7. call ..\configure -prefix %CD%\qtbase -opensource -confirm-license -platform win32-msvc2017 -release ^
    8. -nomake examples -nomake tests -skip qtwebengine -no-openssl -opengl desktop && -developer-build ^
    9. call nmake module-qtbase module-qtdeclarative module-qttools module-qttranslations module-qtwinextras && ^
    10. call nmake install
    To copy to clipboard, switch view to plain text mode 

    This build finishes successfully all the times.

    This is how I'm trying to build IF:
    Qt Code:
    1. call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 10.0.17763.0
    2. SET QTDIR=D:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase
    3. SET QTDIR_LIB=%QTDIR%\lib
    4. SET PATH=%QTDIR%\bin;%QTDIR%\..\..\gnuwin32\bin;%QTDIR_LIB%;D:\tfgit\qt\qt_test2\installer-framework\lib;%PATH%
    5.  
    6. call qmake.exe "LIBS+= -LD:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase\lib -LD:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase\bin -LD:\tfgit\qt\qt_test2\installer-framework\lib" && ^
    7. call nmake && ^
    8. call nmake install
    To copy to clipboard, switch view to plain text mode 

    Example for VS 2015. Same tried for other studios.
    Qt Code:
    1. call qmake.exe "LIBS+= -LD:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase\lib -LD:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase\bin -LD:\tfgit\qt\qt_test2\installer-framework\lib" && ^
    To copy to clipboard, switch view to plain text mode 

    This line also tried different options. This is last try, thats why it looks like this.

    Errors I'm getting are:
    Linker errors when building the installer:

    1. Unresolved RunOnceChecker symbols:
    - RunOnceChecker constructor and destructor
    - RunOnceChecker::isRunning()

    2. Missing QInstaller symbols:
    - QInstaller::init()
    - GenericFactory<QInstaller::PackageManagerPage>
    - QInstaller::PackageManagerPageFactory::instance()

    3. Missing QWinTaskbarButton and QWinTaskbarProgress symbols:
    - Constructors, destructors, and methods

    4. Missing Windows API functions:
    - SHGetFolderPathW
    - Security functions (AllocateAndInitializeSid, etc.)
    - COM functions (CoInitialize, CoUninitialize)
    - Shell functions (ShellExecuteExW)
    - Privilege functions (AdjustTokenPrivileges, etc.)
    - Other Windows APIs (SysAllocString, VariantClear, etc.)

    Total: 38 unresolved external symbols

    Ex:
    Qt Code:
    1. error LNK2001: unresolved external symbol "RunOnceChecker::RunOnceChecker(const QString&)" (__imp_...)
    2. error LNK2001: unresolved external symbol "RunOnceChecker::~RunOnceChecker(void)" (__imp_...)
    3. error LNK2019/LNK2001: unresolved external symbol "bool RunOnceChecker::isRunning(QFlags<RunOnceChecker::ConditionFlag>)" (__imp_...)
    4. main.obj:
    5. error LNK2019: unresolved external symbol "RunOnceChecker::~RunOnceChecker(void)" (__imp_...) referenced in SDKApp destructor
    6. [QWinTaskbarButton & QWinTaskbarProgress]
    7. installer.lib (packagemanagergui.obj, performinstallationform.obj):
    8. error LNK2001/LNK2019: unresolved external symbol "QWinTaskbarButton::QWinTaskbarButton(QObject*)" (__imp_...)
    9. error LNK2001/LNK2019: unresolved external symbol "virtual QWinTaskbarButton::~QWinTaskbarButton(void)" (__imp_...)
    10. error LNK2019: unresolved external symbol "void QWinTaskbarButton::setWindow(QWindow*)" (__imp_...)
    11. error LNK2001/LNK2019: unresolved external symbol "QWindow* QWinTaskbarButton::window(void)const" (__imp_...)
    12. error LNK2001/LNK2019: unresolved external symbol "QWinTaskbarProgress* QWinTaskbarButton::progress(void)const" (__imp_...)
    13. error LNK2001/LNK2019: unresolved external symbol "void QWinTaskbarProgress::setValue(int)" (__imp_...)
    14. error LNK2019: unresolved external symbol "void QWinTaskbarProgress::reset(void)" (__imp_...)
    15. error LNK2019: unresolved external symbol "void QWinTaskbarProgress::setVisible(bool)" (__imp_...)
    16. error LNK2019: unresolved external symbol "void QWinTaskbarProgress::resume(void)" (__imp_...)
    17. error LNK2019: unresolved external symbol "void QWinTaskbarProgress::stop(void)" (__imp_...)
    18. error LNK2001: unresolved external symbol virtual ?????? QWinTaskbarButton (eventFilter, metaObject, qt_metacall, qt_metacast)
    19.  
    20. [Windows API ? COM]
    21. installer.lib (packagemanagercoredata.obj):
    22. error LNK2019: unresolved external symbol "SHGetFolderPathW" (__imp_SHGetFolderPathW)
    23. installer.lib (adminauthorization_win.obj):
    24. error LNK2019: unresolved external symbols "AllocateAndInitializeSid", "CheckTokenMembership", "FreeSid", "ShellExecuteExW", "CoInitialize", "CoUninitialize" (__imp_...)
    25. installer.lib (utils.obj):
    26. error LNK2019: unresolved external symbols "OpenProcessToken", "AdjustTokenPrivileges", "PrivilegeCheck", "LookupPrivilegeValueW" (__imp_...)
    27. 7z.lib (ArchiveExtractCallback.obj, PropVariant.obj, EnumDirItems.obj, 7zHandlerOut.obj):
    28. error LNK2001/LNK2019: unresolved external symbols "OpenProcessToken", "AdjustTokenPrivileges", "SysAllocString", "SysAllocStringLen", "VariantClear", "VariantCopy", "SysFreeString", "GetFileSecurityW", "SetFileSecurityW" (__imp_...)
    29.  
    30. ..\..\bin\installerbase.exe : fatal error LNK1120: 38 unresolved externals
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,321
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Unresolved external symbol while building Installer Framework

    Are you running your scripts from within a Visual Studio Developer Command Prompt terminal window, or from an ordinary DOS Command Prompt window? The VS window sets up the environment for code building, whereas the ordinary prompt simply uses your existing environment. You can find the Developer Command Prompt on the Windows Start menu, under Visual Studio 20xx-> Visual Studio Tools.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Mar 2025
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Unresolved external symbol while building Installer Framework

    Hi! Thank you for you reply!
    I'm calling
    Qt Code:
    1. call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 10.0.17763.0
    To copy to clipboard, switch view to plain text mode 
    On every build. It's script which setups env variables

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,321
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Unresolved external symbol while building Installer Framework

    Are the environment variables set using the "call" command preserved after the call returns? I usually run build scripts from inside a developer command prompt. This guarantees that anything executed within that prompt inherits the build environment. Try commenting out your "call" statement and then executing your script inside the developer command window.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Mar 2025
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Unresolved external symbol while building Installer Framework

    I made this a single script file:

    Qt Code:
    1. call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 10.0.17763.0
    2. SET QTDIR=D:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase
    3. SET QTDIR_LIB=%QTDIR%\lib
    4. SET PATH=%QTDIR%\bin;%QTDIR%\..\..\gnuwin32\bin;%QTDIR_LIB%;D:\tfgit\qt\qt_test2\installer-framework\lib;%PATH%
    5.  
    6. call qmake.exe "LIBS+= -LD:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase\lib -LD:\tfgit\qt\qt_test2\qt_test\qt5\qt5_build\qtbase\bin -LD:\tfgit\qt\qt_test2\installer-framework\lib" && ^
    7. call nmake && ^
    8. call nmake install
    To copy to clipboard, switch view to plain text mode 

    So after call vcvarsall.bat is executed all variables are definitely set during build-script execution. Otherwise nmake command wouldn't have been be found.

    I tried simply running it from developer command prompt(vs 2017): same result, no changes: 38 unresolved external symbols.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,321
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Unresolved external symbol while building Installer Framework

    Well, sorry. Are you sure that you are linking to the correct libraries? In Windows, you cannot mix Release and Debug or 32- and 64-bit libraries. A 64-bit Debug build must be linked with 64-bit Debug libraries, likewise for Release and 32-bit builds. Turn on a verbose build and have it write a log file so you can see all the details.

    Otherwise, I do not know what else to suggest.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Unresolved external symbol
    By Kodeecitizen in forum Qwt
    Replies: 0
    Last Post: 9th April 2019, 18:06
  2. unresolved external symbol
    By davinciomare in forum Newbie
    Replies: 0
    Last Post: 23rd September 2016, 21:12
  3. unresolved external symbol
    By tgreaves in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 19:49
  4. Unresolved External Symbol
    By munna in forum General Discussion
    Replies: 1
    Last Post: 10th May 2006, 19:25

Tags for this Thread

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.