Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Shared library on windows fails when using moc
Forum Updated to NodeBB v4.3 + New Features

Shared library on windows fails when using moc

Scheduled Pinned Locked Moved Solved General and Desktop
41 Posts 4 Posters 12.7k Views 2 Watching
  • 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.
  • MesrineM Mesrine

    @Christian-Ehrlicher
    I have tried but did not work either, maybe is another problem not related with the export macros.

    So if someone has been able to produce shared libraries on Windows while using MOC compiled sources it will be good to know how to do it in CMake.

    Christian EhrlicherC Online
    Christian EhrlicherC Online
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by Christian Ehrlicher
    #12

    @Mesrine said in Shared library on windows fails when using moc:

    I have tried but did not work either, maybe is another problem not related with the export macros.

    Then finally show us what you tried...

    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
    • MesrineM Mesrine

      @Christian-Ehrlicher
      I have tried but did not work either, maybe is another problem not related with the export macros.

      So if someone has been able to produce shared libraries on Windows while using MOC compiled sources it will be good to know how to do it in CMake.

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #13

      @Mesrine It does not matter what you have done. You have to add MYSHAREDLIB_EXPORT into your class definition
      class MYSHAREDLIB_EXPORT MyClass

      But it does not exist in your classes.

      #include <QtCore/QtGlobal>
      
      #if defined(MYSHAREDLIB_LIBRARY)  
      # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
      #else
      #define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
      #endif
      
      

      When you build your lib, add target_compile_definitions(mysharedlib PRIVATE MYSHAREDLIB_LIBRARY). This means your lib exports these classes
      while MYSHAREDLIB_EXPORT=Q_DECL_EXPORT since MYSHAREDLIB_LIBRARY is defined.

      But in your main application, do not add it. However, the headers of all classes in your main application which use the lib have to have MYSHAREDLIB_EXPORT as well. That means these classes import the lib while MYSHAREDLIB_EXPORT=Q_DECL_IMPORT
      since MYSHAREDLIB_LIBRARY is not defined .

      Christian EhrlicherC MesrineM 4 Replies Last reply
      0
      • JoeCFDJ JoeCFD

        @Mesrine It does not matter what you have done. You have to add MYSHAREDLIB_EXPORT into your class definition
        class MYSHAREDLIB_EXPORT MyClass

        But it does not exist in your classes.

        #include <QtCore/QtGlobal>
        
        #if defined(MYSHAREDLIB_LIBRARY)  
        # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
        #else
        #define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
        #endif
        
        

        When you build your lib, add target_compile_definitions(mysharedlib PRIVATE MYSHAREDLIB_LIBRARY). This means your lib exports these classes
        while MYSHAREDLIB_EXPORT=Q_DECL_EXPORT since MYSHAREDLIB_LIBRARY is defined.

        But in your main application, do not add it. However, the headers of all classes in your main application which use the lib have to have MYSHAREDLIB_EXPORT as well. That means these classes import the lib while MYSHAREDLIB_EXPORT=Q_DECL_IMPORT
        since MYSHAREDLIB_LIBRARY is not defined .

        Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #14

        @JoeCFD said in Shared library on windows fails when using moc:

        #if defined(_WIN32) || defined(WIN32)

        This is not needed and even counter-productive when you want to hide the symbols on linux.

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

        JoeCFDJ 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @JoeCFD said in Shared library on windows fails when using moc:

          #if defined(_WIN32) || defined(WIN32)

          This is not needed and even counter-productive when you want to hide the symbols on linux.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #15

          @Christian-Ehrlicher Got it, thanks. Q_DECL_EXPORT and Q_DECL_IMPORT have it already. But for non Qt code, this is needed.

          Christian EhrlicherC 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @Christian-Ehrlicher Got it, thanks. Q_DECL_EXPORT and Q_DECL_IMPORT have it already. But for non Qt code, this is needed.

            Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #16

            @JoeCFD said in Shared library on windows fails when using moc:

            But for non Qt code, this is needed.

            Even then I would use the correct attribution. Hiding the symbols by default on linux will help the linker and startup time and (iirc) also the optimizer in the linker since it can remove unused functions / inline stuff when it's not visible from outside.

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

            JoeCFDJ 1 Reply Last reply
            1
            • JoeCFDJ JoeCFD

              @Mesrine It does not matter what you have done. You have to add MYSHAREDLIB_EXPORT into your class definition
              class MYSHAREDLIB_EXPORT MyClass

              But it does not exist in your classes.

              #include <QtCore/QtGlobal>
              
              #if defined(MYSHAREDLIB_LIBRARY)  
              # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
              #else
              #define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
              #endif
              
              

              When you build your lib, add target_compile_definitions(mysharedlib PRIVATE MYSHAREDLIB_LIBRARY). This means your lib exports these classes
              while MYSHAREDLIB_EXPORT=Q_DECL_EXPORT since MYSHAREDLIB_LIBRARY is defined.

              But in your main application, do not add it. However, the headers of all classes in your main application which use the lib have to have MYSHAREDLIB_EXPORT as well. That means these classes import the lib while MYSHAREDLIB_EXPORT=Q_DECL_IMPORT
              since MYSHAREDLIB_LIBRARY is not defined .

              MesrineM Offline
              MesrineM Offline
              Mesrine
              wrote on last edited by
              #17

              @JoeCFD said in Shared library on windows fails when using moc:

              MYSHAREDLIB_LIBRARY

              Yes, I tried that and give the same error.

              Then my question is when should i define MYSHAREDLIB_LIBRARY in cmake?
              When compiling the library?
              If compiling the client should i set MYSHAREDLIB_LIBRARY?

              In my case compiling the client download the source code of the library and compile the source code.
              The target resulting from that shared library is linked to the client using cmake .

              Maybe i found my problem while writing this.
              I will do what Qt says(exactly :)) and try again, I llet you know the result and the code.

              Thanks.

              Christian EhrlicherC JoeCFDJ 2 Replies Last reply
              0
              • MesrineM Mesrine

                @JoeCFD said in Shared library on windows fails when using moc:

                MYSHAREDLIB_LIBRARY

                Yes, I tried that and give the same error.

                Then my question is when should i define MYSHAREDLIB_LIBRARY in cmake?
                When compiling the library?
                If compiling the client should i set MYSHAREDLIB_LIBRARY?

                In my case compiling the client download the source code of the library and compile the source code.
                The target resulting from that shared library is linked to the client using cmake .

                Maybe i found my problem while writing this.
                I will do what Qt says(exactly :)) and try again, I llet you know the result and the code.

                Thanks.

                Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #18

                @Mesrine said in Shared library on windows fails when using moc:

                Then my question is when should i define MYSHAREDLIB_LIBRARY in cmake?
                When compiling the library?

                add target_compile_definitions(mysharedlib PRIVATE MYSHAREDLIB_LIBRARY)

                And instead 'MYSHAREDLIB' you should use your library name...

                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
                • Christian EhrlicherC Christian Ehrlicher

                  @JoeCFD said in Shared library on windows fails when using moc:

                  But for non Qt code, this is needed.

                  Even then I would use the correct attribution. Hiding the symbols by default on linux will help the linker and startup time and (iirc) also the optimizer in the linker since it can remove unused functions / inline stuff when it's not visible from outside.

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by
                  #19

                  @Christian-Ehrlicher
                  Good to know, Thanks. I have not used Windows for ages.

                    #if __GNUC__ >= 4
                      #define DLL_PUBLIC __attribute__ ((visibility ("default")))
                      #define DLL_LOCAL  __attribute__ ((visibility ("hidden")))
                    #else
                      #define DLL_PUBLIC
                      #define DLL_LOCAL
                    #endif
                  
                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • JoeCFDJ JoeCFD

                    @Christian-Ehrlicher
                    Good to know, Thanks. I have not used Windows for ages.

                      #if __GNUC__ >= 4
                        #define DLL_PUBLIC __attribute__ ((visibility ("default")))
                        #define DLL_LOCAL  __attribute__ ((visibility ("hidden")))
                      #else
                        #define DLL_PUBLIC
                        #define DLL_LOCAL
                      #endif
                    
                    Christian EhrlicherC Online
                    Christian EhrlicherC Online
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #20

                    @JoeCFD You have then compile with -fvisibility-inlines-hidden -fvisibility=hiddenand get the same behavior like the (default) windows behavior. See CMAKE_CXX_VISIBILITY_PRESET for more information on how to use it platform independent with cmake.

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

                    JoeCFDJ 1 Reply Last reply
                    1
                    • MesrineM Mesrine

                      @JoeCFD said in Shared library on windows fails when using moc:

                      MYSHAREDLIB_LIBRARY

                      Yes, I tried that and give the same error.

                      Then my question is when should i define MYSHAREDLIB_LIBRARY in cmake?
                      When compiling the library?
                      If compiling the client should i set MYSHAREDLIB_LIBRARY?

                      In my case compiling the client download the source code of the library and compile the source code.
                      The target resulting from that shared library is linked to the client using cmake .

                      Maybe i found my problem while writing this.
                      I will do what Qt says(exactly :)) and try again, I llet you know the result and the code.

                      Thanks.

                      JoeCFDJ Offline
                      JoeCFDJ Offline
                      JoeCFD
                      wrote on last edited by JoeCFD
                      #21

                      @Mesrine Take a look at the source code of any Qt module. You do the same thing.

                      1 Reply Last reply
                      0
                      • Christian EhrlicherC Christian Ehrlicher

                        @JoeCFD You have then compile with -fvisibility-inlines-hidden -fvisibility=hiddenand get the same behavior like the (default) windows behavior. See CMAKE_CXX_VISIBILITY_PRESET for more information on how to use it platform independent with cmake.

                        JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by
                        #22

                        @Christian-Ehrlicher Thanks. Learn more things from you.

                        1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD

                          @Mesrine It does not matter what you have done. You have to add MYSHAREDLIB_EXPORT into your class definition
                          class MYSHAREDLIB_EXPORT MyClass

                          But it does not exist in your classes.

                          #include <QtCore/QtGlobal>
                          
                          #if defined(MYSHAREDLIB_LIBRARY)  
                          # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
                          #else
                          #define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
                          #endif
                          
                          

                          When you build your lib, add target_compile_definitions(mysharedlib PRIVATE MYSHAREDLIB_LIBRARY). This means your lib exports these classes
                          while MYSHAREDLIB_EXPORT=Q_DECL_EXPORT since MYSHAREDLIB_LIBRARY is defined.

                          But in your main application, do not add it. However, the headers of all classes in your main application which use the lib have to have MYSHAREDLIB_EXPORT as well. That means these classes import the lib while MYSHAREDLIB_EXPORT=Q_DECL_IMPORT
                          since MYSHAREDLIB_LIBRARY is not defined .

                          MesrineM Offline
                          MesrineM Offline
                          Mesrine
                          wrote on last edited by Mesrine
                          #23

                          @JoeCFD said in Shared library on windows fails when using moc:

                          MYSHAREDLIB_EXPORT

                          But still i have to define MYSHAREDLIB_EXPORT to nothing if compiling in other system apart from windows?

                          JoeCFDJ Christian EhrlicherC 2 Replies Last reply
                          0
                          • JoeCFDJ JoeCFD

                            @Mesrine It does not matter what you have done. You have to add MYSHAREDLIB_EXPORT into your class definition
                            class MYSHAREDLIB_EXPORT MyClass

                            But it does not exist in your classes.

                            #include <QtCore/QtGlobal>
                            
                            #if defined(MYSHAREDLIB_LIBRARY)  
                            # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
                            #else
                            #define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
                            #endif
                            
                            

                            When you build your lib, add target_compile_definitions(mysharedlib PRIVATE MYSHAREDLIB_LIBRARY). This means your lib exports these classes
                            while MYSHAREDLIB_EXPORT=Q_DECL_EXPORT since MYSHAREDLIB_LIBRARY is defined.

                            But in your main application, do not add it. However, the headers of all classes in your main application which use the lib have to have MYSHAREDLIB_EXPORT as well. That means these classes import the lib while MYSHAREDLIB_EXPORT=Q_DECL_IMPORT
                            since MYSHAREDLIB_LIBRARY is not defined .

                            MesrineM Offline
                            MesrineM Offline
                            Mesrine
                            wrote on last edited by
                            #24

                            @JoeCFD

                            grep on the sources of qt gives:

                            grep -r "Q_DECL_IMPORT"
                            qcompilerdetection.qdoc:    \sa Q_DECL_IMPORT
                            qcompilerdetection.qdoc:    \macro Q_DECL_IMPORT
                            qtconfigmacros.h:#    define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
                            qversiontagging.h:    extern "C" Q_DECL_IMPORT const char sym; \
                            qcompilerdetection.h:#  define Q_DECL_IMPORT __declspec(dllimport)
                            qcompilerdetection.h:#    define Q_DECL_IMPORT     __attribute__((visibility("default")))
                            qcompilerdetection.h:#    define Q_DECL_IMPORT     __declspec(dllimport)
                            qcompilerdetection.h:#    define Q_DECL_IMPORT     __declspec(dllimport)
                            qcompilerdetection.h:#    define Q_DECL_IMPORT     __attribute__((visibility("default")))
                            qcompilerdetection.h:#ifndef Q_DECL_IMPORT
                            qcompilerdetection.h:#  define Q_DECL_IMPORT
                            
                            1 Reply Last reply
                            0
                            • MesrineM Mesrine

                              @JoeCFD said in Shared library on windows fails when using moc:

                              MYSHAREDLIB_EXPORT

                              But still i have to define MYSHAREDLIB_EXPORT to nothing if compiling in other system apart from windows?

                              JoeCFDJ Offline
                              JoeCFDJ Offline
                              JoeCFD
                              wrote on last edited by
                              #25

                              @Mesrine Q_DECL_IMPORT and Q_DECL_EXPORT are hidden for example on Linux. No worries.

                              1 Reply Last reply
                              0
                              • MesrineM Mesrine

                                @JoeCFD said in Shared library on windows fails when using moc:

                                MYSHAREDLIB_EXPORT

                                But still i have to define MYSHAREDLIB_EXPORT to nothing if compiling in other system apart from windows?

                                Christian EhrlicherC Online
                                Christian EhrlicherC Online
                                Christian Ehrlicher
                                Lifetime Qt Champion
                                wrote on last edited by
                                #26

                                @Mesrine said in Shared library on windows fails when using moc:

                                But still i have to define MYSHAREDLIB_EXPORT to nothing if compiling in other system apart from windows?

                                Why? Simply use it as explained in the Qt documentation...

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

                                SGaistS 1 Reply Last reply
                                0
                                • Christian EhrlicherC Christian Ehrlicher

                                  @Mesrine said in Shared library on windows fails when using moc:

                                  But still i have to define MYSHAREDLIB_EXPORT to nothing if compiling in other system apart from windows?

                                  Why? Simply use it as explained in the Qt documentation...

                                  SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #27

                                  Hi,

                                  You are over complicating things.

                                  As already suggested by @Christian-Ehrlicher, just follow the doc:

                                  • create one header with the macro definition as shown in the documentation
                                  • in your code include that header in all the classes you want to export and use the macro there
                                  • update your CMakeLists.txt as shown
                                  • rebuild

                                  And you should be good to go. There's really nothing more to it than that.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  MesrineM 1 Reply Last reply
                                  0
                                  • SGaistS SGaist

                                    Hi,

                                    You are over complicating things.

                                    As already suggested by @Christian-Ehrlicher, just follow the doc:

                                    • create one header with the macro definition as shown in the documentation
                                    • in your code include that header in all the classes you want to export and use the macro there
                                    • update your CMakeLists.txt as shown
                                    • rebuild

                                    And you should be good to go. There's really nothing more to it than that.

                                    MesrineM Offline
                                    MesrineM Offline
                                    Mesrine
                                    wrote on last edited by Mesrine
                                    #28

                                    @SGaist

                                    I tried on the shared library

                                    #include <QtCore/QtGlobal>
                                    
                                    #if defined(MYSHAREDLIB_LIBRARY)
                                    # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
                                    #else
                                    #define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
                                    #endif
                                    namespace qiota{
                                    
                                    	namespace qpow {
                                    
                                    
                                    		class MYSHAREDLIB_EXPORT nonceFinder : public QObject
                                    		{
                                    			Q_OBJECT
                                    			public:
                                    

                                    in the cmakelist.txt of the shared library

                                    add_library(qpow include/pow/qpow.hpp qpow.cpp)
                                    target_compile_definitions(qpow PRIVATE MYSHAREDLIB_LIBRARY)
                                    

                                    As you can see on this commit
                                    This compiles the library in windows, linux, macos shared and static as before.

                                    I did the same for the client library as you can see for the
                                    comparison of the branch

                                    but this again fails for windows shared library as you can see form the workflow run with error

                                      cmake --build .
                                      shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
                                      env:
                                        CommandPromptType: Native
                                        DevEnvDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\
                                        ExtensionSdkDir: C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
                                        EXTERNAL_INCLUDE: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
                                        Framework40Version: v4.0
                                        FrameworkDir: C:\Windows\Microsoft.NET\Framework64\
                                        FrameworkDir64: C:\Windows\Microsoft.NET\Framework64\
                                        FrameworkVersion: v4.0.30319
                                        FrameworkVersion64: v4.0.30319
                                        FSHARPINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools
                                        HTMLHelpDir: C:\Program Files (x86)\HTML Help Workshop
                                        INCLUDE: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
                                        is_x64_arch: true
                                        LIB: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64
                                        LIBPATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
                                        NETFXSDKDir: C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\
                                        Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\CodeCoverage.Console;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.9.3\x64;C:\cabal\bin;C:\\ghcup\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.3.0\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.4\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.6\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.372-7\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\Installer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
                                        Platform: x64
                                        UCRTVersion: 10.0.22621.0
                                        UniversalCRTSdkDir: C:\Program Files (x86)\Windows Kits\10\
                                        VCIDEInstallDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\
                                        VCINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\
                                        VCToolsInstallDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\
                                        VCToolsRedistDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.34.31931\
                                        VCToolsVersion: 14.34.31933
                                        VisualStudioVersion: 17.0
                                        VS170COMNTOOLS: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\
                                        VSCMD_ARG_app_plat: Desktop
                                        VSCMD_ARG_HOST_ARCH: x64
                                        VSCMD_ARG_TGT_ARCH: x64
                                        VSCMD_VER: 17.5.5
                                        VSINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
                                        VSSDK150INSTALL: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK
                                        VSSDKINSTALL: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK
                                        WindowsLibPath: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0
                                        WindowsSdkBinPath: C:\Program Files (x86)\Windows Kits\10\bin\
                                        WindowsSdkDir: C:\Program Files (x86)\Windows Kits\10\
                                        WindowsSDKLibVersion: 10.0.22621.0\
                                        WindowsSdkVerBinPath: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\
                                        WindowsSDKVersion: 10.0.22621.0\
                                        WindowsSDK_ExecutablePath_x64: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\
                                        WindowsSDK_ExecutablePath_x86: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\
                                        __DOTNET_ADD_64BIT: 1
                                        __DOTNET_PREFERRED_BITNESS: 64
                                        __VSCMD_PREINIT_PATH: C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.9.3\x64;C:\cabal\bin;C:\\ghcup\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.3.0\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.4\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.6\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.372-7\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\Installer
                                        pythonLocation: C:\hostedtoolcache\windows\Python\3.11.3\x64
                                    [42/101] Building CXX object _deps\qed25519-build\CMakeFiles\qed25519.dir\qed25519.cpp.obj
                                    [43/101] Linking CXX shared library qbech32.dll
                                    [44/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\add_scalar.c.obj
                                    [45/101] Linking CXX shared library qpow.dll
                                    [46/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\fe.c.obj
                                    [47/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\ge.c.obj
                                    [48/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\key_exchange.c.obj
                                    [49/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\keypair.c.obj
                                    [50/101] Automatic MOC and UIC for target qclient
                                    [51/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\sc.c.obj
                                    [52/101] Building CXX object CMakeFiles\qclient.dir\qclient_autogen\mocs_compilation.cpp.obj
                                    [53/101] Building CXX object CMakeFiles\qclient.dir\qclient.cpp.obj
                                    [54/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_response.cpp.obj
                                    [55/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_info.cpp.obj
                                    [56/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_tips.cpp.obj
                                    [57/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_blockId.cpp.obj
                                    [58/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_block.cpp.obj
                                    [59/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_outputs.cpp.obj
                                    [60/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\sha512.c.obj
                                    [61/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\sign.c.obj
                                    [62/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\verify.c.obj
                                    [63/101] Automatic MOC and UIC for target qslip10
                                    [64/101] Building CXX object _deps\qslip10-build\CMakeFiles\qslip10.dir\qslip10_autogen\mocs_compilation.cpp.obj
                                    [65/101] Linking CXX shared library qclient.dll
                                    FAILED: qclient.dll qclient.lib 
                                    cmd.exe /C "cmd.exe /C ""C:\Program Files\CMake\bin\cmake.exe" -E __create_def D:\a\_temp\build\CMakeFiles\qclient.dir\.\exports.def D:\a\_temp\build\CMakeFiles\qclient.dir\.\exports.def.objs && cd D:\a\_temp\build" && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\qclient.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\bin\HostX64\x64\link.exe /nologo CMakeFiles\qclient.dir\qclient_autogen\mocs_compilation.cpp.obj CMakeFiles\qclient.dir\qclient.cpp.obj CMakeFiles\qclient.dir\src\qnode_response.cpp.obj CMakeFiles\qclient.dir\src\qnode_info.cpp.obj CMakeFiles\qclient.dir\src\qnode_tips.cpp.obj CMakeFiles\qclient.dir\src\qnode_blockId.cpp.obj CMakeFiles\qclient.dir\src\qnode_block.cpp.obj CMakeFiles\qclient.dir\src\qnode_outputs.cpp.obj  /out:qclient.dll /implib:qclient.lib /pdb:qclient.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO  /DEF:CMakeFiles\qclient.dir\.\exports.def  D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Network.lib  _deps\qblock-build\qblock.lib  _deps\qpow-build\qpow.lib  ws2_32.lib  _deps\qbigint-build\qbigint.lib  D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Core.lib  mpr.lib  userenv.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
                                    LINK: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\bin\HostX64\x64\link.exe /nologo CMakeFiles\qclient.dir\qclient_autogen\mocs_compilation.cpp.obj CMakeFiles\qclient.dir\qclient.cpp.obj CMakeFiles\qclient.dir\src\qnode_response.cpp.obj CMakeFiles\qclient.dir\src\qnode_info.cpp.obj CMakeFiles\qclient.dir\src\qnode_tips.cpp.obj CMakeFiles\qclient.dir\src\qnode_blockId.cpp.obj CMakeFiles\qclient.dir\src\qnode_block.cpp.obj CMakeFiles\qclient.dir\src\qnode_outputs.cpp.obj /out:qclient.dll /implib:qclient.lib /pdb:qclient.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /DEF:CMakeFiles\qclient.dir\.\exports.def D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Network.lib _deps\qblock-build\qblock.lib _deps\qpow-build\qpow.lib ws2_32.lib _deps\qbigint-build\qbigint.lib D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Core.lib mpr.lib userenv.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:qclient.dll.manifest" failed (exit code 1120) with the following output:
                                       Creating library qclient.lib and object qclient.exp
                                    qclient.cpp.obj : error LNK2019: unresolved external symbol "public: static struct QMetaObject const qiota::qpow::nonceFinder::staticMetaObject" (?staticMetaObject@nonceFinder@qpow@qiota@@2UQMetaObject@@B) referenced in function "public: static class QMetaObject::Connection __cdecl QObject::connect<void (__cdecl qiota::qpow::nonceFinder::*)(void),class `public: __cdecl `public: __cdecl `public: void __cdecl qiota::Client::send_block(class qiota::qblocks::Block const &)'::`2'::<lambda_2>::operator()(void)const '::`2'::<lambda_1>::operator()(void)const '::`5'::<lambda_2> >(class qiota::qpow::nonceFinder const *,void (__cdecl qiota::qpow::nonceFinder::*)(void),class QObject const *,class `public: __cdecl `public: __cdecl `public: void __cdecl qiota::Client::send_block(class qiota::qblocks::Block const &)'::`2'::<lambda_2>::operator()(void)const '::`2'::<lambda_1>::operator()(void)const '::`5'::<lambda_2>,enum Qt::ConnectionType)" (??$connect@P8nonceFinder@qpow@qiota@@EAAXXZV<lambda_2>@?4???R<lambda_1>@?1???R4?1??send_block@Client@3@QEAAXAEBVBlock@qblocks@3@@Z@QEBA@XZ@QEBA@XZ@@QObject@@SA?AVConnection@QMetaObject@@PEBVnonceFinder@qpow@qiota@@P8345@EAAXXZPEBV0@V<lambda_2>@?4???R<lambda_1>@?1???R6?1??send_block@Client@5@QEAAXAEBVBlock@qblocks@5@@Z@QEBA@XZ@QEBA@XZ@W4ConnectionType@Qt@@@Z)
                                    
                                    qclient.dll : fatal error LNK1120: 1 unresolved externals
                                    
                                    [66/101] Building CXX object _deps\qslip10-build\CMakeFiles\qslip10.dir\qslip10.cpp.obj
                                    [67/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\seed.c.obj
                                    ninja: build stopped: subcommand failed.
                                    Error: Process completed with exit code 1.
                                    

                                    I believe is the same error than before.

                                    Christian EhrlicherC MesrineM 2 Replies Last reply
                                    0
                                    • MesrineM Mesrine

                                      @SGaist

                                      I tried on the shared library

                                      #include <QtCore/QtGlobal>
                                      
                                      #if defined(MYSHAREDLIB_LIBRARY)
                                      # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
                                      #else
                                      #define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
                                      #endif
                                      namespace qiota{
                                      
                                      	namespace qpow {
                                      
                                      
                                      		class MYSHAREDLIB_EXPORT nonceFinder : public QObject
                                      		{
                                      			Q_OBJECT
                                      			public:
                                      

                                      in the cmakelist.txt of the shared library

                                      add_library(qpow include/pow/qpow.hpp qpow.cpp)
                                      target_compile_definitions(qpow PRIVATE MYSHAREDLIB_LIBRARY)
                                      

                                      As you can see on this commit
                                      This compiles the library in windows, linux, macos shared and static as before.

                                      I did the same for the client library as you can see for the
                                      comparison of the branch

                                      but this again fails for windows shared library as you can see form the workflow run with error

                                        cmake --build .
                                        shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
                                        env:
                                          CommandPromptType: Native
                                          DevEnvDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\
                                          ExtensionSdkDir: C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
                                          EXTERNAL_INCLUDE: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
                                          Framework40Version: v4.0
                                          FrameworkDir: C:\Windows\Microsoft.NET\Framework64\
                                          FrameworkDir64: C:\Windows\Microsoft.NET\Framework64\
                                          FrameworkVersion: v4.0.30319
                                          FrameworkVersion64: v4.0.30319
                                          FSHARPINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools
                                          HTMLHelpDir: C:\Program Files (x86)\HTML Help Workshop
                                          INCLUDE: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
                                          is_x64_arch: true
                                          LIB: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64
                                          LIBPATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
                                          NETFXSDKDir: C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\
                                          Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\CodeCoverage.Console;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.9.3\x64;C:\cabal\bin;C:\\ghcup\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.3.0\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.4\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.6\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.372-7\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\Installer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
                                          Platform: x64
                                          UCRTVersion: 10.0.22621.0
                                          UniversalCRTSdkDir: C:\Program Files (x86)\Windows Kits\10\
                                          VCIDEInstallDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\
                                          VCINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\
                                          VCToolsInstallDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\
                                          VCToolsRedistDir: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.34.31931\
                                          VCToolsVersion: 14.34.31933
                                          VisualStudioVersion: 17.0
                                          VS170COMNTOOLS: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\
                                          VSCMD_ARG_app_plat: Desktop
                                          VSCMD_ARG_HOST_ARCH: x64
                                          VSCMD_ARG_TGT_ARCH: x64
                                          VSCMD_VER: 17.5.5
                                          VSINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
                                          VSSDK150INSTALL: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK
                                          VSSDKINSTALL: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK
                                          WindowsLibPath: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0
                                          WindowsSdkBinPath: C:\Program Files (x86)\Windows Kits\10\bin\
                                          WindowsSdkDir: C:\Program Files (x86)\Windows Kits\10\
                                          WindowsSDKLibVersion: 10.0.22621.0\
                                          WindowsSdkVerBinPath: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\
                                          WindowsSDKVersion: 10.0.22621.0\
                                          WindowsSDK_ExecutablePath_x64: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\
                                          WindowsSDK_ExecutablePath_x86: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\
                                          __DOTNET_ADD_64BIT: 1
                                          __DOTNET_PREFERRED_BITNESS: 64
                                          __VSCMD_PREINIT_PATH: C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.9.3\x64;C:\cabal\bin;C:\\ghcup\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.3.0\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.4\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.6\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.372-7\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\Installer
                                          pythonLocation: C:\hostedtoolcache\windows\Python\3.11.3\x64
                                      [42/101] Building CXX object _deps\qed25519-build\CMakeFiles\qed25519.dir\qed25519.cpp.obj
                                      [43/101] Linking CXX shared library qbech32.dll
                                      [44/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\add_scalar.c.obj
                                      [45/101] Linking CXX shared library qpow.dll
                                      [46/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\fe.c.obj
                                      [47/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\ge.c.obj
                                      [48/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\key_exchange.c.obj
                                      [49/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\keypair.c.obj
                                      [50/101] Automatic MOC and UIC for target qclient
                                      [51/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\sc.c.obj
                                      [52/101] Building CXX object CMakeFiles\qclient.dir\qclient_autogen\mocs_compilation.cpp.obj
                                      [53/101] Building CXX object CMakeFiles\qclient.dir\qclient.cpp.obj
                                      [54/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_response.cpp.obj
                                      [55/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_info.cpp.obj
                                      [56/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_tips.cpp.obj
                                      [57/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_blockId.cpp.obj
                                      [58/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_block.cpp.obj
                                      [59/101] Building CXX object CMakeFiles\qclient.dir\src\qnode_outputs.cpp.obj
                                      [60/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\sha512.c.obj
                                      [61/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\sign.c.obj
                                      [62/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\verify.c.obj
                                      [63/101] Automatic MOC and UIC for target qslip10
                                      [64/101] Building CXX object _deps\qslip10-build\CMakeFiles\qslip10.dir\qslip10_autogen\mocs_compilation.cpp.obj
                                      [65/101] Linking CXX shared library qclient.dll
                                      FAILED: qclient.dll qclient.lib 
                                      cmd.exe /C "cmd.exe /C ""C:\Program Files\CMake\bin\cmake.exe" -E __create_def D:\a\_temp\build\CMakeFiles\qclient.dir\.\exports.def D:\a\_temp\build\CMakeFiles\qclient.dir\.\exports.def.objs && cd D:\a\_temp\build" && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\qclient.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\bin\HostX64\x64\link.exe /nologo CMakeFiles\qclient.dir\qclient_autogen\mocs_compilation.cpp.obj CMakeFiles\qclient.dir\qclient.cpp.obj CMakeFiles\qclient.dir\src\qnode_response.cpp.obj CMakeFiles\qclient.dir\src\qnode_info.cpp.obj CMakeFiles\qclient.dir\src\qnode_tips.cpp.obj CMakeFiles\qclient.dir\src\qnode_blockId.cpp.obj CMakeFiles\qclient.dir\src\qnode_block.cpp.obj CMakeFiles\qclient.dir\src\qnode_outputs.cpp.obj  /out:qclient.dll /implib:qclient.lib /pdb:qclient.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO  /DEF:CMakeFiles\qclient.dir\.\exports.def  D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Network.lib  _deps\qblock-build\qblock.lib  _deps\qpow-build\qpow.lib  ws2_32.lib  _deps\qbigint-build\qbigint.lib  D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Core.lib  mpr.lib  userenv.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
                                      LINK: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\bin\HostX64\x64\link.exe /nologo CMakeFiles\qclient.dir\qclient_autogen\mocs_compilation.cpp.obj CMakeFiles\qclient.dir\qclient.cpp.obj CMakeFiles\qclient.dir\src\qnode_response.cpp.obj CMakeFiles\qclient.dir\src\qnode_info.cpp.obj CMakeFiles\qclient.dir\src\qnode_tips.cpp.obj CMakeFiles\qclient.dir\src\qnode_blockId.cpp.obj CMakeFiles\qclient.dir\src\qnode_block.cpp.obj CMakeFiles\qclient.dir\src\qnode_outputs.cpp.obj /out:qclient.dll /implib:qclient.lib /pdb:qclient.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /DEF:CMakeFiles\qclient.dir\.\exports.def D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Network.lib _deps\qblock-build\qblock.lib _deps\qpow-build\qpow.lib ws2_32.lib _deps\qbigint-build\qbigint.lib D:\a\Qclient-IOTA\Qt\6.5.0\msvc2019_64\lib\Qt6Core.lib mpr.lib userenv.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:qclient.dll.manifest" failed (exit code 1120) with the following output:
                                         Creating library qclient.lib and object qclient.exp
                                      qclient.cpp.obj : error LNK2019: unresolved external symbol "public: static struct QMetaObject const qiota::qpow::nonceFinder::staticMetaObject" (?staticMetaObject@nonceFinder@qpow@qiota@@2UQMetaObject@@B) referenced in function "public: static class QMetaObject::Connection __cdecl QObject::connect<void (__cdecl qiota::qpow::nonceFinder::*)(void),class `public: __cdecl `public: __cdecl `public: void __cdecl qiota::Client::send_block(class qiota::qblocks::Block const &)'::`2'::<lambda_2>::operator()(void)const '::`2'::<lambda_1>::operator()(void)const '::`5'::<lambda_2> >(class qiota::qpow::nonceFinder const *,void (__cdecl qiota::qpow::nonceFinder::*)(void),class QObject const *,class `public: __cdecl `public: __cdecl `public: void __cdecl qiota::Client::send_block(class qiota::qblocks::Block const &)'::`2'::<lambda_2>::operator()(void)const '::`2'::<lambda_1>::operator()(void)const '::`5'::<lambda_2>,enum Qt::ConnectionType)" (??$connect@P8nonceFinder@qpow@qiota@@EAAXXZV<lambda_2>@?4???R<lambda_1>@?1???R4?1??send_block@Client@3@QEAAXAEBVBlock@qblocks@3@@Z@QEBA@XZ@QEBA@XZ@@QObject@@SA?AVConnection@QMetaObject@@PEBVnonceFinder@qpow@qiota@@P8345@EAAXXZPEBV0@V<lambda_2>@?4???R<lambda_1>@?1???R6?1??send_block@Client@5@QEAAXAEBVBlock@qblocks@5@@Z@QEBA@XZ@QEBA@XZ@W4ConnectionType@Qt@@@Z)
                                      
                                      qclient.dll : fatal error LNK1120: 1 unresolved externals
                                      
                                      [66/101] Building CXX object _deps\qslip10-build\CMakeFiles\qslip10.dir\qslip10.cpp.obj
                                      [67/101] Building C object _deps\qed25519-build\CMakeFiles\qed25519.dir\src\seed.c.obj
                                      ninja: build stopped: subcommand failed.
                                      Error: Process completed with exit code 1.
                                      

                                      I believe is the same error than before.

                                      Christian EhrlicherC Online
                                      Christian EhrlicherC Online
                                      Christian Ehrlicher
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #29

                                      I don't see the include of the generated moc file 'moc_qpow.h' in your code.

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

                                      MesrineM 1 Reply Last reply
                                      0
                                      • Christian EhrlicherC Christian Ehrlicher

                                        I don't see the include of the generated moc file 'moc_qpow.h' in your code.

                                        MesrineM Offline
                                        MesrineM Offline
                                        Mesrine
                                        wrote on last edited by
                                        #30

                                        @Christian-Ehrlicher
                                        Where should i put this on qpow.cpp?

                                        Christian EhrlicherC 1 Reply Last reply
                                        0
                                        • MesrineM Mesrine

                                          @Christian-Ehrlicher
                                          Where should i put this on qpow.cpp?

                                          Christian EhrlicherC Online
                                          Christian EhrlicherC Online
                                          Christian Ehrlicher
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #31

                                          @Mesrine doesn't matter - includes should go to the top.

                                          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