Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt5.15.2 amd64 Build from src - Missing symbol export "_cdecl QUnhandledException"
Forum Updated to NodeBB v4.3 + New Features

Qt5.15.2 amd64 Build from src - Missing symbol export "_cdecl QUnhandledException"

Scheduled Pinned Locked Moved Solved Installation and Deployment
5 Posts 2 Posters 488 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NiVa99
    wrote on last edited by
    #1

    Hi,

    After build in amd64 with MSVC2019 Qt5.15.2 from source, I made the observation that public _cdecl QUnhandledException symbol was not exported.

    The source are from https://download.qt.io/archive/qt/5.15/5.15.2/single/

    And the configuration cmd windows script is as this :

    CALL "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build/vcvarsall.bat" amd64
      
    set "CMAKE_ROOT=C:\CMake\bin"
    set "NINJA_ROOT=C:\ninja-win"
    set "PERL_ROOT=C:\Strawberry\perl\bin"
       
    set PATH=%CMAKE_ROOT%;%PATH%
    set PATH=%NINJA_ROOT%;%PATH%
    set PATH=%PERL_ROOT%;%PATH%
    set PATH=C:\Python311-amd64;%PATH%
         
    rem Check if the tools are in PATH
    where perl.exe
    where python.exe
    where cmake.exe
    where ninja.exe
     
    set "MY_INSTALL_PATH=qt-5.15.2-build-vs2019"
    set CL=/MP
     
    cmake -G "Visual Studio 16 2019"
    
    configure.bat -prefix %MY_INSTALL_PATH% -release -force-debug-info -platform win32-msvc -opensource -confirm-license -nomake tests -nomake examples
    

    The differences is in Qt5Core.dll as shown on attached picture Qt5-5-7___cdecl_QUnhandledException__OK.PNG Qt5-15-2___missing__cdecl_QUnhandledException__KO.PNG

    And it results in error LNK 2001 unresolved external Symbol.

    Erreur	LNK2001	symbole externe non résolu "__declspec(dllimport) public: virtual __cdecl QUnhandledException::~QUnhandledException(void)" (__imp_??1QUnhandledException@@UEAA@XZ)
    
    Erreur	LNK2001	symbole externe non résolu "__declspec(dllimport) public: __cdecl QUnhandledException::QUnhandledException(void)" (__imp_??0QUnhandledException@@QEAA@XZ)
    
    Erreur	LNK2001	symbole externe non résolu "__declspec(dllimport) public: void __cdecl QFutureInterfaceBase::reportException(class QException const &)" (__imp_?reportException@QFutureInterfaceBase@@QEAAXAEBVQException@@@Z)
    

    Sample code was taken here qtconcurrentrun.html#using-member-functions

    #include <iostream>
    
    #include <QtCore/QObject>
    #include <QtCore/QtCore>
    #include <QtCore/QFuture> 
    #include <QtCore/QUnhandledException>
    
    #include <QtConcurrent/QtConcurrentVersion> 
    #include <QtConcurrent/QtConcurrent> 
    #include <QtConcurrent/QtConcurrentRun> 
    #include <QtConcurrent/QtConcurrentMap>
    
    
    int main()
    {
        // from https://doc.qt.io/qt-5/qtconcurrentrun.html#using-member-functions
        QByteArray bytearray = "Hello World!";
        // QFuture<QList<QByteArray> > future = 
        QtConcurrent::run(bytearray, &QByteArray::split, ',');
        //QList<QByteArray> result = future.result();
    }
    
    1 Reply Last reply
    0
    • N Offline
      N Offline
      NiVa99
      wrote on last edited by NiVa99
      #2

      By changing configure option like this

      CALL "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build/vcvarsall.bat" amd64
        
      set "CMAKE_ROOT=C:\CMake\bin"
      set "NINJA_ROOT=C:\ninja-win"
      set "PERL_ROOT=C:\Strawberry\perl\bin"
         
      set PATH=%CMAKE_ROOT%;%PATH%
      set PATH=%NINJA_ROOT%;%PATH%
      set PATH=%PERL_ROOT%;%PATH%
      set PATH=C:\Python311-amd64;%PATH%
           
      rem Check if the tools are in PATH
      where perl.exe
      where python.exe
      where cmake.exe
      where ninja.exe
       
      set "MY_INSTALL_PATH=qt-5.15.2-build-vs2019"
      set CL=/MP
       
      cmake -G "Visual Studio 16 2019"
      
      :: configure.bat -prefix %MY_INSTALL_PATH% -release -force-debug-info -platform win32-msvc -opensource -confirm-license -nomake tests -nomake examples
      configure.bat -prefix %MY_INSTALL_PATH% **-developer-build** -release -force-debug-info -platform win32-msvc -opensource -confirm-license -nomake tests -nomake examples
      

      It fixed the issue.
      Qt5-5-7___cdecl_QUnhandledException__Qt5Core_Fixed.PNG

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        You compile Qt without exceptions support and then wonder why an exception is not in your dll? Wow.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • N Offline
          N Offline
          NiVa99
          wrote on last edited by
          #4

          think -developer-build option is the main diff. I had tested with exceptions option and Qt5Core did not embbed QUnhandled::exception. Tested today.

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @NiVa99 said in Qt5.15.2 amd64 Build from src - Missing symbol export "_cdecl QUnhandledException":

            think -developer-build option is the main diff. I

            No, see the header of qexception.h - you disable a feature and Qt just does what you asked for.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved