Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. undefined reference to `sm3_digest'
Forum Updated to NodeBB v4.3 + New Features

undefined reference to `sm3_digest'

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
26 Posts 6 Posters 4.6k Views 1 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.
  • H hhhl01

    @SGaist Hello, I am building a project based on the windows platform. I am a little confused. Why does the library have to be 32-bit?

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #11

    @hhhl01 said in undefined reference to `sm3_digest':

    Why does the library have to be 32-bit?

    It gets a bit complicated! Your actual Windows is doubtless 64-bit. That can run either 64- or 32-bit applications. Programs or libraries are compiled as either 64- or 32-bit. You cannot mix any 64- and 32-bit stuff within any one application, that and everything it links with must all be one or the other.

    Your pasted error message shows that you are building your Qt application as 32-bit (...MinGW_32bit-Debug...). Somewhere you elected to do that. That means it will only link successfully against libraries also built 32-bit. If your gmssl has actually been built as 64-bit it's not going to work.

    found that GmSSL is built on standard 64-bit systems, but at the same time, it also supports 32-bit systems

    I'm not sure exactly what that means. Let's put it aside for now.

    Start by looking inside your GMSSL\lib folder. You are looking for a file named libgmssl.a. Do you find that? If so, exactly where? If perchance you do not find that but instead a .lib file named gmssl.lib that would indicate it has been compiled by MSVC and you won't be able to use MInGW. Otherwise if you do have a libgmssl.a we need to know whether it is 32- or 64-bit. If the latter you would have to change to compiling your own Qt program for 64-bit in order to link with it.

    H 1 Reply Last reply
    1
    • JonBJ JonB

      @hhhl01 said in undefined reference to `sm3_digest':

      Why does the library have to be 32-bit?

      It gets a bit complicated! Your actual Windows is doubtless 64-bit. That can run either 64- or 32-bit applications. Programs or libraries are compiled as either 64- or 32-bit. You cannot mix any 64- and 32-bit stuff within any one application, that and everything it links with must all be one or the other.

      Your pasted error message shows that you are building your Qt application as 32-bit (...MinGW_32bit-Debug...). Somewhere you elected to do that. That means it will only link successfully against libraries also built 32-bit. If your gmssl has actually been built as 64-bit it's not going to work.

      found that GmSSL is built on standard 64-bit systems, but at the same time, it also supports 32-bit systems

      I'm not sure exactly what that means. Let's put it aside for now.

      Start by looking inside your GMSSL\lib folder. You are looking for a file named libgmssl.a. Do you find that? If so, exactly where? If perchance you do not find that but instead a .lib file named gmssl.lib that would indicate it has been compiled by MSVC and you won't be able to use MInGW. Otherwise if you do have a libgmssl.a we need to know whether it is 32- or 64-bit. If the latter you would have to change to compiling your own Qt program for 64-bit in order to link with it.

      H Offline
      H Offline
      hhhl01
      wrote on last edited by
      #12

      @JonB Thanks for your reply, I seem to understand what you mean. I just checked that there is only a .lib file named gmssl.lib under GMSSL\lib, which is the library linked to my .pro file. The libgmssl.a file was not found, so the solution is to compile the GMSSL library into 32-bit using mingw? I'm not sure if this is a good approach.

      JonBJ 1 Reply Last reply
      0
      • H hhhl01

        @JonB Thanks for your reply, I seem to understand what you mean. I just checked that there is only a .lib file named gmssl.lib under GMSSL\lib, which is the library linked to my .pro file. The libgmssl.a file was not found, so the solution is to compile the GMSSL library into 32-bit using mingw? I'm not sure if this is a good approach.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #13

        @hhhl01 said in undefined reference to `sm3_digest':

        that there is only a .lib file named gmssl.lib

        The libgmssl.a file was not found

        so the solution is to compile the GMSSL library into 32-bit using mingw?

        gmssl.lib means that was compiled with MSVC. You cannot use that to link against anything of yours compiled with MinGW, regardless of bit-ness. You have 2 choices:

        • If gmssl.lib was supplied to you from whatever the "GMSSL" package is, and you want to use it, you will have to change over to using MSVC instead of MinGW for all your application code you write. You will still have to discover whether the .lib file is 32- or 64-bit and compile your stuff with MSVC correspondingly.

        • If you compile the GMSSL sources yourself you can recompile with MinGW (again, correct 32- or 64-bit for whatever you intend to compile your Qt stuff as), producing a libgmssl.a this time, and you will be able to link against that for your stuff compiled with MinGW. You may find that the GMSSL sources can only be compiled with MSVC, not written to allow MinGW: if so you will have to abandon MinGW and do it and your stuff all with MSVC instead.

        The instructions for GMSSL really should document all this.

        NOTE:
        I don't use Windows or MSVC/MinGW. The above is pretty close to correct. The one thing I am not 100% certain about: if, and only if, GMSSL is C only and no C++ it might be that you can link against a generated .lib file. I say this because I think some Windows system libraries are C-only, are compiled with MSVC and have a .lib extension yet have to be acceptable to MinGW. If that is your route you would have to await someone who knows about this specific area.

        P.S.
        In http://gmssl.org/docs/install.html my limited knowledge of Chinese ;-) indicates it is intended to be built with MSVC/Visual Studio. What evidence do you have it will ever compile/work with MinGW?

        H 4 Replies Last reply
        0
        • JonBJ JonB

          @hhhl01 said in undefined reference to `sm3_digest':

          that there is only a .lib file named gmssl.lib

          The libgmssl.a file was not found

          so the solution is to compile the GMSSL library into 32-bit using mingw?

          gmssl.lib means that was compiled with MSVC. You cannot use that to link against anything of yours compiled with MinGW, regardless of bit-ness. You have 2 choices:

          • If gmssl.lib was supplied to you from whatever the "GMSSL" package is, and you want to use it, you will have to change over to using MSVC instead of MinGW for all your application code you write. You will still have to discover whether the .lib file is 32- or 64-bit and compile your stuff with MSVC correspondingly.

          • If you compile the GMSSL sources yourself you can recompile with MinGW (again, correct 32- or 64-bit for whatever you intend to compile your Qt stuff as), producing a libgmssl.a this time, and you will be able to link against that for your stuff compiled with MinGW. You may find that the GMSSL sources can only be compiled with MSVC, not written to allow MinGW: if so you will have to abandon MinGW and do it and your stuff all with MSVC instead.

          The instructions for GMSSL really should document all this.

          NOTE:
          I don't use Windows or MSVC/MinGW. The above is pretty close to correct. The one thing I am not 100% certain about: if, and only if, GMSSL is C only and no C++ it might be that you can link against a generated .lib file. I say this because I think some Windows system libraries are C-only, are compiled with MSVC and have a .lib extension yet have to be acceptable to MinGW. If that is your route you would have to await someone who knows about this specific area.

          P.S.
          In http://gmssl.org/docs/install.html my limited knowledge of Chinese ;-) indicates it is intended to be built with MSVC/Visual Studio. What evidence do you have it will ever compile/work with MinGW?

          H Offline
          H Offline
          hhhl01
          wrote on last edited by
          #14

          @JonB Thank you for answering so thoughtfully. I will try the method you proposed to try to solve the problem. If there are any results, I will reply to you later. Thank you again!

          1 Reply Last reply
          0
          • JonBJ JonB

            @hhhl01 said in undefined reference to `sm3_digest':

            that there is only a .lib file named gmssl.lib

            The libgmssl.a file was not found

            so the solution is to compile the GMSSL library into 32-bit using mingw?

            gmssl.lib means that was compiled with MSVC. You cannot use that to link against anything of yours compiled with MinGW, regardless of bit-ness. You have 2 choices:

            • If gmssl.lib was supplied to you from whatever the "GMSSL" package is, and you want to use it, you will have to change over to using MSVC instead of MinGW for all your application code you write. You will still have to discover whether the .lib file is 32- or 64-bit and compile your stuff with MSVC correspondingly.

            • If you compile the GMSSL sources yourself you can recompile with MinGW (again, correct 32- or 64-bit for whatever you intend to compile your Qt stuff as), producing a libgmssl.a this time, and you will be able to link against that for your stuff compiled with MinGW. You may find that the GMSSL sources can only be compiled with MSVC, not written to allow MinGW: if so you will have to abandon MinGW and do it and your stuff all with MSVC instead.

            The instructions for GMSSL really should document all this.

            NOTE:
            I don't use Windows or MSVC/MinGW. The above is pretty close to correct. The one thing I am not 100% certain about: if, and only if, GMSSL is C only and no C++ it might be that you can link against a generated .lib file. I say this because I think some Windows system libraries are C-only, are compiled with MSVC and have a .lib extension yet have to be acceptable to MinGW. If that is your route you would have to await someone who knows about this specific area.

            P.S.
            In http://gmssl.org/docs/install.html my limited knowledge of Chinese ;-) indicates it is intended to be built with MSVC/Visual Studio. What evidence do you have it will ever compile/work with MinGW?

            H Offline
            H Offline
            hhhl01
            wrote on last edited by
            #15

            @JonB said in undefined reference to `sm3_digest':

            What evidence do you have it will ever compile/work with MinGW?

            There is no evidence yet, I am just wondering if it is possible, but it seems to be very troublesome to do so.

            1 Reply Last reply
            0
            • JonBJ JonB

              @hhhl01 said in undefined reference to `sm3_digest':

              that there is only a .lib file named gmssl.lib

              The libgmssl.a file was not found

              so the solution is to compile the GMSSL library into 32-bit using mingw?

              gmssl.lib means that was compiled with MSVC. You cannot use that to link against anything of yours compiled with MinGW, regardless of bit-ness. You have 2 choices:

              • If gmssl.lib was supplied to you from whatever the "GMSSL" package is, and you want to use it, you will have to change over to using MSVC instead of MinGW for all your application code you write. You will still have to discover whether the .lib file is 32- or 64-bit and compile your stuff with MSVC correspondingly.

              • If you compile the GMSSL sources yourself you can recompile with MinGW (again, correct 32- or 64-bit for whatever you intend to compile your Qt stuff as), producing a libgmssl.a this time, and you will be able to link against that for your stuff compiled with MinGW. You may find that the GMSSL sources can only be compiled with MSVC, not written to allow MinGW: if so you will have to abandon MinGW and do it and your stuff all with MSVC instead.

              The instructions for GMSSL really should document all this.

              NOTE:
              I don't use Windows or MSVC/MinGW. The above is pretty close to correct. The one thing I am not 100% certain about: if, and only if, GMSSL is C only and no C++ it might be that you can link against a generated .lib file. I say this because I think some Windows system libraries are C-only, are compiled with MSVC and have a .lib extension yet have to be acceptable to MinGW. If that is your route you would have to await someone who knows about this specific area.

              P.S.
              In http://gmssl.org/docs/install.html my limited knowledge of Chinese ;-) indicates it is intended to be built with MSVC/Visual Studio. What evidence do you have it will ever compile/work with MinGW?

              H Offline
              H Offline
              hhhl01
              wrote on last edited by
              #16

              @JonB Sorry it took so long to get back to you.I still haven't been able to solve this problem. I replaced the mingw 32-bit compiler with msvc 64-bit, but it still can't link to the library correctly.
              148562fc-dca9-41fe-a95a-5bc92f85c23e-image.png

              ad5da839-3e82-49ff-9c8f-800a251635e5-image.png

              9983498b-10c4-4dcf-8764-d8e2e7dfd797-屏幕截图 2024-09-01 215631.png

              The Chinese meaning here is:
              upgrade_protocol.obj : error LNK2019: unresolved external symbol sm3_digest referenced in function "private: class std::vector<unsigned char, class std::allocator<unsigned char>> __cdecl UpgradeProtocol::sm3Hash(class std::vector<unsigned char, class std::allocator<unsigned char>> const &)" (?sm3Hash@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBV23@@Z)

              I don't know if it's the same problem as the one I encountered before. I'm thinking if it's a library problem.Looking forward to your reply, thank you.

              JonBJ 1 Reply Last reply
              0
              • JonBJ JonB

                @hhhl01 said in undefined reference to &#x60;sm3_digest':

                that there is only a .lib file named gmssl.lib

                The libgmssl.a file was not found

                so the solution is to compile the GMSSL library into 32-bit using mingw?

                gmssl.lib means that was compiled with MSVC. You cannot use that to link against anything of yours compiled with MinGW, regardless of bit-ness. You have 2 choices:

                • If gmssl.lib was supplied to you from whatever the "GMSSL" package is, and you want to use it, you will have to change over to using MSVC instead of MinGW for all your application code you write. You will still have to discover whether the .lib file is 32- or 64-bit and compile your stuff with MSVC correspondingly.

                • If you compile the GMSSL sources yourself you can recompile with MinGW (again, correct 32- or 64-bit for whatever you intend to compile your Qt stuff as), producing a libgmssl.a this time, and you will be able to link against that for your stuff compiled with MinGW. You may find that the GMSSL sources can only be compiled with MSVC, not written to allow MinGW: if so you will have to abandon MinGW and do it and your stuff all with MSVC instead.

                The instructions for GMSSL really should document all this.

                NOTE:
                I don't use Windows or MSVC/MinGW. The above is pretty close to correct. The one thing I am not 100% certain about: if, and only if, GMSSL is C only and no C++ it might be that you can link against a generated .lib file. I say this because I think some Windows system libraries are C-only, are compiled with MSVC and have a .lib extension yet have to be acceptable to MinGW. If that is your route you would have to await someone who knows about this specific area.

                P.S.
                In http://gmssl.org/docs/install.html my limited knowledge of Chinese ;-) indicates it is intended to be built with MSVC/Visual Studio. What evidence do you have it will ever compile/work with MinGW?

                H Offline
                H Offline
                hhhl01
                wrote on last edited by
                #17

                @JonB I also need to explain that my current development environment is the windows platform.
                42a13039-7932-4909-9c75-0caed58ea3a1-image.png
                And the external library I linked to is 64-bit.
                2cc5eb03-d909-4949-990e-dde05302714e-屏幕截图 2024-09-02 175150.png
                I think there is no problem with my build environment, so is it possible that the Windows platform is causing this error?

                jsulmJ 1 Reply Last reply
                0
                • H hhhl01

                  @JonB I also need to explain that my current development environment is the windows platform.
                  42a13039-7932-4909-9c75-0caed58ea3a1-image.png
                  And the external library I linked to is 64-bit.
                  2cc5eb03-d909-4949-990e-dde05302714e-屏幕截图 2024-09-02 175150.png
                  I think there is no problem with my build environment, so is it possible that the Windows platform is causing this error?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #18

                  @hhhl01 Please post you current pro file and also the output of the linker during the build. And please post text, not pictures.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  H 1 Reply Last reply
                  0
                  • H hhhl01

                    @JonB Sorry it took so long to get back to you.I still haven't been able to solve this problem. I replaced the mingw 32-bit compiler with msvc 64-bit, but it still can't link to the library correctly.
                    148562fc-dca9-41fe-a95a-5bc92f85c23e-image.png

                    ad5da839-3e82-49ff-9c8f-800a251635e5-image.png

                    9983498b-10c4-4dcf-8764-d8e2e7dfd797-屏幕截图 2024-09-01 215631.png

                    The Chinese meaning here is:
                    upgrade_protocol.obj : error LNK2019: unresolved external symbol sm3_digest referenced in function "private: class std::vector<unsigned char, class std::allocator<unsigned char>> __cdecl UpgradeProtocol::sm3Hash(class std::vector<unsigned char, class std::allocator<unsigned char>> const &)" (?sm3Hash@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBV23@@Z)

                    I don't know if it's the same problem as the one I encountered before. I'm thinking if it's a library problem.Looking forward to your reply, thank you.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #19

                    @hhhl01
                    Maybe @jsulm can help you.

                    But I have to say: this doesn't seem to be anything to do with Qt, nobody knows what GMSSL is all about, there are basically no hits on the web for sm3_digest. This is really down to you to find out what is required to build it correctly from its documentation.

                    H 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @hhhl01 Please post you current pro file and also the output of the linker during the build. And please post text, not pictures.

                      H Offline
                      H Offline
                      hhhl01
                      wrote on last edited by
                      #20

                      @jsulm Hello.Thanks Hello.Thanks for your reply. This is my .pro file.

                      * * * * ```
                      #-------------------------------------------------
                      #
                      # Project created by QtCreator 2024-07-04T18:09:10
                      #
                      #-------------------------------------------------
                      
                      CONFIG += c++11
                      
                      QT       += core gui widgets serialport network
                      
                      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                      
                      TARGET = ClientPro
                      TEMPLATE = app
                      
                      # The following define makes your compiler emit warnings if you use
                      # any feature of Qt which has been marked as deprecated (the exact warnings
                      # depend on your compiler). Please consult the documentation of the
                      # deprecated API in order to know how to port your code away from it.
                      DEFINES += QT_DEPRECATED_WARNINGS
                      
                      # You can also make your code fail to compile if you use deprecated APIs.
                      # In order to do so, uncomment the following line.
                      # You can also select to disable deprecated APIs only up to a certain version of Qt.
                      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                      
                      
                      SOURCES += \
                              main.cpp \
                              widget.cpp \
                          uart_process.cpp \
                          lan_process.cpp \
                          process_thread.cpp \
                          upgrade_protocol.cpp
                      
                      HEADERS += \
                              widget.h \
                          uart_process.h \
                          lan_process.h \
                          process_thread.h \
                          upgrade_protocol.h
                      
                      FORMS += \
                              widget.ui
                      
                      
                      msvc {
                          QMAKE_CFLAGS += /utf-8
                          QMAKE_CXXFLAGS += /utf-8
                      }
                      
                      win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../GmSSL/release/gmssl.lib
                      else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../GmSSL/debug/gmssl.lib
                      else:unix:!macx: LIBS += -L$$PWD/../../GmSSL/gmssl.lib
                      
                      INCLUDEPATH += $$PWD/../../GmSSL/include
                      DEPENDPATH += $$PWD/../../GmSSL/include
                      
                      
                      And below is the output of the linker.
                      
                      10:04:40: 为项目ClientPro执行步骤 ...
                      10:04:40: 正在启动 "D:\qt\Tools\QtCreator\bin\jom\jom.exe" clean
                      
                      	D:\qt\Tools\QtCreator\bin\jom\jom.exe -f Makefile.Debug clean
                      	del debug\moc_predefs.h
                      找不到 D:\qtPro\ClientPro\debug\moc_predefs.h
                      	del debug\moc_widget.cpp debug\moc_process_thread.cpp debug\moc_upgrade_protocol.cpp
                      	del ui_widget.h
                      找不到 D:\qtPro\ClientPro\debug\moc_widget.cpp
                      找不到 D:\qtPro\ClientPro\ui_widget.h
                      	del debug\main.obj debug\widget.obj debug\uart_process.obj debug\lan_process.obj debug\process_thread.obj debug\upgrade_protocol.obj debug\moc_widget.obj debug\moc_process_thread.obj debug\moc_upgrade_protocol.obj
                      找不到 D:\qtPro\ClientPro\debug\main.obj
                      	del debug\ClientPro.exp debug\ClientPro.vc.pdb debug\ClientPro.ilk debug\ClientPro.idb
                      找不到 D:\qtPro\ClientPro\debug\ClientPro.exp
                      	D:\qt\Tools\QtCreator\bin\jom\jom.exe -f Makefile.Release clean
                      	del release\moc_predefs.h
                      	del release\moc_widget.cpp release\moc_process_thread.cpp release\moc_upgrade_protocol.cpp
                      	del ui_widget.h
                      	del release\main.obj release\widget.obj release\uart_process.obj release\lan_process.obj release\process_thread.obj release\upgrade_protocol.obj release\moc_widget.obj release\moc_process_thread.obj release\moc_upgrade_protocol.obj
                      	del release\ClientPro.exp
                      找不到 D:\qtPro\ClientPro\release\moc_predefs.h
                      找不到 D:\qtPro\ClientPro\release\moc_widget.cpp
                      找不到 D:\qtPro\ClientPro\ui_widget.h
                      找不到 D:\qtPro\ClientPro\release\main.obj
                      找不到 D:\qtPro\ClientPro\release\ClientPro.exp
                      	del ClientPro.exp
                      找不到 D:\qtPro\ClientPro\ClientPro.exp
                      	del ClientPro.vc.pdb
                      找不到 D:\qtPro\ClientPro\ClientPro.vc.pdb
                      	del ClientPro.ilk
                      找不到 D:\qtPro\ClientPro\ClientPro.ilk
                      	del ClientPro.idb
                      找不到 D:\qtPro\ClientPro\ClientPro.idb
                      10:04:41: 进程"D:\qt\Tools\QtCreator\bin\jom\jom.exe"正常退出。
                      10:04:41: 正在启动 "C:\Program Files\msvc2017_64\bin\qmake.exe" D:\qtPro\ClientPro\ClientPro.pro -spec win32-msvc "CONFIG+=debug"
                      
                      10:04:41: 进程"C:\Program Files\msvc2017_64\bin\qmake.exe"正常退出。
                      10:04:41: 正在启动 "D:\qt\Tools\QtCreator\bin\jom\jom.exe" -f D:/qtPro/ClientPro/Makefile qmake_all
                      
                      
                      jom 1.1.4 - empower your cores
                      
                      10:04:41: 进程"D:\qt\Tools\QtCreator\bin\jom\jom.exe"正常退出。
                      10:04:41: 正在启动 "D:\qt\Tools\QtCreator\bin\jom\jom.exe" 
                      
                      	D:\qt\Tools\QtCreator\bin\jom\jom.exe -f Makefile.Debug
                      	"C:\Program Files\msvc2017_64\bin\uic.exe" widget.ui -o ui_widget.h
                      widget.ui: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget1'.
                      widget.ui: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget2'.
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\main.obj.4208.0.jom
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\uart_process.obj.4208.15.jom
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\lan_process.obj.4208.15.jom
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\process_thread.obj.4208.31.jom
                      uart_process.cpp
                      lan_process.cpp
                      main.cpp
                      process_thread.cpp
                      	cl -Bx"C:\Program Files\msvc2017_64\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E "C:\Program Files\msvc2017_64\mkspecs\features\data\dummy.cpp" 2>NUL >debug\moc_predefs.h
                      	"C:\Program Files\msvc2017_64\bin\moc.exe" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include debug/moc_predefs.h -I"C:/Program Files/msvc2017_64/mkspecs/win32-msvc" -ID:/qtPro/ClientPro -ID:/GmSSL/include -I"C:/Program Files/msvc2017_64/include" -I"C:/Program Files/msvc2017_64/include/QtWidgets" -I"C:/Program Files/msvc2017_64/include/QtGui" -I"C:/Program Files/msvc2017_64/include/QtANGLE" -I"C:/Program Files/msvc2017_64/include/QtSerialPort" -I"C:/Program Files/msvc2017_64/include/QtNetwork" -I"C:/Program Files/msvc2017_64/include/QtCore" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" process_thread.h -o debug\moc_process_thread.cpp
                      	"C:\Program Files\msvc2017_64\bin\moc.exe" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include debug/moc_predefs.h -I"C:/Program Files/msvc2017_64/mkspecs/win32-msvc" -ID:/qtPro/ClientPro -ID:/GmSSL/include -I"C:/Program Files/msvc2017_64/include" -I"C:/Program Files/msvc2017_64/include/QtWidgets" -I"C:/Program Files/msvc2017_64/include/QtGui" -I"C:/Program Files/msvc2017_64/include/QtANGLE" -I"C:/Program Files/msvc2017_64/include/QtSerialPort" -I"C:/Program Files/msvc2017_64/include/QtNetwork" -I"C:/Program Files/msvc2017_64/include/QtCore" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" upgrade_protocol.h -o debug\moc_upgrade_protocol.cpp
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\upgrade_protocol.obj.4208.31.jom
                      upgrade_protocol.cpp
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\widget.obj.4208.47.jom
                      widget.cpp
                      	"C:\Program Files\msvc2017_64\bin\moc.exe" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include debug/moc_predefs.h -I"C:/Program Files/msvc2017_64/mkspecs/win32-msvc" -ID:/qtPro/ClientPro -ID:/GmSSL/include -I"C:/Program Files/msvc2017_64/include" -I"C:/Program Files/msvc2017_64/include/QtWidgets" -I"C:/Program Files/msvc2017_64/include/QtGui" -I"C:/Program Files/msvc2017_64/include/QtANGLE" -I"C:/Program Files/msvc2017_64/include/QtSerialPort" -I"C:/Program Files/msvc2017_64/include/QtNetwork" -I"C:/Program Files/msvc2017_64/include/QtCore" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" widget.h -o debug\moc_widget.cpp
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\moc_process_thread.obj.4208.328.jom
                      moc_process_thread.cpp
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\moc_upgrade_protocol.obj.4208.375.jom
                      moc_upgrade_protocol.cpp
                      main.cpp(10): warning C4189: “codec”: 局部变量已初始化但不引用
                      	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\moc_widget.obj.4208.390.jom
                      moc_widget.cpp
                      upgrade_protocol.cpp(141): warning C4267: “初始化”: 从“size_t”转换到“uint16_t”,可能丢失数据
                      upgrade_protocol.cpp(180): warning C4189: “dataLength”: 局部变量已初始化但不引用
                      	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\ClientPro.exe @C:\Users\21443\AppData\Local\Temp\ClientPro.exe.4208.1453.jom
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm3_digest,函数 "private: class std::vector<unsigned char,class std::allocator<unsigned char> > __cdecl UpgradeProtocol::sm3Hash(class std::vector<unsigned char,class std::allocator<unsigned char> > const &)" (?sm3Hash@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBV23@@Z) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_point_from_octets,函数 "private: struct SM2_KEY __cdecl UpgradeProtocol::loadSM2PublicKeyFromData(class std::vector<unsigned char,class std::allocator<unsigned char> > const &)" (?loadSM2PublicKeyFromData@UpgradeProtocol@@AEAA?AUSM2_KEY@@AEBV?$vector@EV?$allocator@E@std@@@std@@@Z) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_key_generate,函数 "private: void __cdecl UpgradeProtocol::generateAndSaveSM2PrivateKey(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?generateAndSaveSM2PrivateKey@UpgradeProtocol@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_key_set_public_key,函数 "private: struct SM2_KEY __cdecl UpgradeProtocol::loadSM2PublicKeyFromData(class std::vector<unsigned char,class std::allocator<unsigned char> > const &)" (?loadSM2PublicKeyFromData@UpgradeProtocol@@AEAA?AUSM2_KEY@@AEBV?$vector@EV?$allocator@E@std@@@std@@@Z) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_private_key_to_pem,函数 "private: void __cdecl UpgradeProtocol::generateAndSaveSM2PrivateKey(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?generateAndSaveSM2PrivateKey@UpgradeProtocol@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_private_key_from_pem,函数 "private: struct SM2_KEY __cdecl UpgradeProtocol::loadSM2PrivateKey(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadSM2PrivateKey@UpgradeProtocol@@AEAA?AUSM2_KEY@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_encrypt,函数 "private: class std::vector<unsigned char,class std::allocator<unsigned char> > __cdecl UpgradeProtocol::sm2Encrypt(struct SM2_KEY const &)" (?sm2Encrypt@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBUSM2_KEY@@@Z) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm4_set_encrypt_key,函数 "private: void __cdecl UpgradeProtocol::generateSM4Key(void)" (?generateSM4Key@UpgradeProtocol@@AEAAXXZ) 中引用了该符号
                      upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm4_cbc_encrypt,函数 "private: class std::vector<unsigned char,class std::allocator<unsigned char> > __cdecl UpgradeProtocol::sm4Encrypt(class std::vector<unsigned char,class std::allocator<unsigned char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > &)" (?sm4Encrypt@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBV23@AEAV23@@Z) 中引用了该符号
                      debug\ClientPro.exe : fatal error LNK1120: 9 个无法解析的外部命令
                      jom: D:\qtPro\ClientPro\Makefile.Debug [debug\ClientPro.exe] Error 1120
                      jom: D:\qtPro\ClientPro\Makefile [debug] Error 2
                      10:04:43: 进程"D:\qt\Tools\QtCreator\bin\jom\jom.exe"退出,退出代码 2 。
                      Error while building/deploying project ClientPro (kit: Replacement for "Desktop Qt 5.11.1 MSVC2017 64bit")
                      When executing step "Make"
                      10:04:43: Elapsed time: 00:02.
                      jsulmJ 1 Reply Last reply
                      0
                      • JonBJ JonB

                        @hhhl01
                        Maybe @jsulm can help you.

                        But I have to say: this doesn't seem to be anything to do with Qt, nobody knows what GMSSL is all about, there are basically no hits on the web for sm3_digest. This is really down to you to find out what is required to build it correctly from its documentation.

                        H Offline
                        H Offline
                        hhhl01
                        wrote on last edited by
                        #21

                        @JonB Thank you, I will try to find out the cause of the problem and will get back to you if there are any results.This library is indeed relatively rare, but I cannot modify the specifications in the project.

                        1 Reply Last reply
                        0
                        • H hhhl01

                          @jsulm Hello.Thanks Hello.Thanks for your reply. This is my .pro file.

                          * * * * ```
                          #-------------------------------------------------
                          #
                          # Project created by QtCreator 2024-07-04T18:09:10
                          #
                          #-------------------------------------------------
                          
                          CONFIG += c++11
                          
                          QT       += core gui widgets serialport network
                          
                          greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                          
                          TARGET = ClientPro
                          TEMPLATE = app
                          
                          # The following define makes your compiler emit warnings if you use
                          # any feature of Qt which has been marked as deprecated (the exact warnings
                          # depend on your compiler). Please consult the documentation of the
                          # deprecated API in order to know how to port your code away from it.
                          DEFINES += QT_DEPRECATED_WARNINGS
                          
                          # You can also make your code fail to compile if you use deprecated APIs.
                          # In order to do so, uncomment the following line.
                          # You can also select to disable deprecated APIs only up to a certain version of Qt.
                          #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                          
                          
                          SOURCES += \
                                  main.cpp \
                                  widget.cpp \
                              uart_process.cpp \
                              lan_process.cpp \
                              process_thread.cpp \
                              upgrade_protocol.cpp
                          
                          HEADERS += \
                                  widget.h \
                              uart_process.h \
                              lan_process.h \
                              process_thread.h \
                              upgrade_protocol.h
                          
                          FORMS += \
                                  widget.ui
                          
                          
                          msvc {
                              QMAKE_CFLAGS += /utf-8
                              QMAKE_CXXFLAGS += /utf-8
                          }
                          
                          win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../GmSSL/release/gmssl.lib
                          else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../GmSSL/debug/gmssl.lib
                          else:unix:!macx: LIBS += -L$$PWD/../../GmSSL/gmssl.lib
                          
                          INCLUDEPATH += $$PWD/../../GmSSL/include
                          DEPENDPATH += $$PWD/../../GmSSL/include
                          
                          
                          And below is the output of the linker.
                          
                          10:04:40: 为项目ClientPro执行步骤 ...
                          10:04:40: 正在启动 "D:\qt\Tools\QtCreator\bin\jom\jom.exe" clean
                          
                          	D:\qt\Tools\QtCreator\bin\jom\jom.exe -f Makefile.Debug clean
                          	del debug\moc_predefs.h
                          找不到 D:\qtPro\ClientPro\debug\moc_predefs.h
                          	del debug\moc_widget.cpp debug\moc_process_thread.cpp debug\moc_upgrade_protocol.cpp
                          	del ui_widget.h
                          找不到 D:\qtPro\ClientPro\debug\moc_widget.cpp
                          找不到 D:\qtPro\ClientPro\ui_widget.h
                          	del debug\main.obj debug\widget.obj debug\uart_process.obj debug\lan_process.obj debug\process_thread.obj debug\upgrade_protocol.obj debug\moc_widget.obj debug\moc_process_thread.obj debug\moc_upgrade_protocol.obj
                          找不到 D:\qtPro\ClientPro\debug\main.obj
                          	del debug\ClientPro.exp debug\ClientPro.vc.pdb debug\ClientPro.ilk debug\ClientPro.idb
                          找不到 D:\qtPro\ClientPro\debug\ClientPro.exp
                          	D:\qt\Tools\QtCreator\bin\jom\jom.exe -f Makefile.Release clean
                          	del release\moc_predefs.h
                          	del release\moc_widget.cpp release\moc_process_thread.cpp release\moc_upgrade_protocol.cpp
                          	del ui_widget.h
                          	del release\main.obj release\widget.obj release\uart_process.obj release\lan_process.obj release\process_thread.obj release\upgrade_protocol.obj release\moc_widget.obj release\moc_process_thread.obj release\moc_upgrade_protocol.obj
                          	del release\ClientPro.exp
                          找不到 D:\qtPro\ClientPro\release\moc_predefs.h
                          找不到 D:\qtPro\ClientPro\release\moc_widget.cpp
                          找不到 D:\qtPro\ClientPro\ui_widget.h
                          找不到 D:\qtPro\ClientPro\release\main.obj
                          找不到 D:\qtPro\ClientPro\release\ClientPro.exp
                          	del ClientPro.exp
                          找不到 D:\qtPro\ClientPro\ClientPro.exp
                          	del ClientPro.vc.pdb
                          找不到 D:\qtPro\ClientPro\ClientPro.vc.pdb
                          	del ClientPro.ilk
                          找不到 D:\qtPro\ClientPro\ClientPro.ilk
                          	del ClientPro.idb
                          找不到 D:\qtPro\ClientPro\ClientPro.idb
                          10:04:41: 进程"D:\qt\Tools\QtCreator\bin\jom\jom.exe"正常退出。
                          10:04:41: 正在启动 "C:\Program Files\msvc2017_64\bin\qmake.exe" D:\qtPro\ClientPro\ClientPro.pro -spec win32-msvc "CONFIG+=debug"
                          
                          10:04:41: 进程"C:\Program Files\msvc2017_64\bin\qmake.exe"正常退出。
                          10:04:41: 正在启动 "D:\qt\Tools\QtCreator\bin\jom\jom.exe" -f D:/qtPro/ClientPro/Makefile qmake_all
                          
                          
                          jom 1.1.4 - empower your cores
                          
                          10:04:41: 进程"D:\qt\Tools\QtCreator\bin\jom\jom.exe"正常退出。
                          10:04:41: 正在启动 "D:\qt\Tools\QtCreator\bin\jom\jom.exe" 
                          
                          	D:\qt\Tools\QtCreator\bin\jom\jom.exe -f Makefile.Debug
                          	"C:\Program Files\msvc2017_64\bin\uic.exe" widget.ui -o ui_widget.h
                          widget.ui: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget1'.
                          widget.ui: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget2'.
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\main.obj.4208.0.jom
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\uart_process.obj.4208.15.jom
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\lan_process.obj.4208.15.jom
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\process_thread.obj.4208.31.jom
                          uart_process.cpp
                          lan_process.cpp
                          main.cpp
                          process_thread.cpp
                          	cl -Bx"C:\Program Files\msvc2017_64\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E "C:\Program Files\msvc2017_64\mkspecs\features\data\dummy.cpp" 2>NUL >debug\moc_predefs.h
                          	"C:\Program Files\msvc2017_64\bin\moc.exe" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include debug/moc_predefs.h -I"C:/Program Files/msvc2017_64/mkspecs/win32-msvc" -ID:/qtPro/ClientPro -ID:/GmSSL/include -I"C:/Program Files/msvc2017_64/include" -I"C:/Program Files/msvc2017_64/include/QtWidgets" -I"C:/Program Files/msvc2017_64/include/QtGui" -I"C:/Program Files/msvc2017_64/include/QtANGLE" -I"C:/Program Files/msvc2017_64/include/QtSerialPort" -I"C:/Program Files/msvc2017_64/include/QtNetwork" -I"C:/Program Files/msvc2017_64/include/QtCore" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" process_thread.h -o debug\moc_process_thread.cpp
                          	"C:\Program Files\msvc2017_64\bin\moc.exe" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include debug/moc_predefs.h -I"C:/Program Files/msvc2017_64/mkspecs/win32-msvc" -ID:/qtPro/ClientPro -ID:/GmSSL/include -I"C:/Program Files/msvc2017_64/include" -I"C:/Program Files/msvc2017_64/include/QtWidgets" -I"C:/Program Files/msvc2017_64/include/QtGui" -I"C:/Program Files/msvc2017_64/include/QtANGLE" -I"C:/Program Files/msvc2017_64/include/QtSerialPort" -I"C:/Program Files/msvc2017_64/include/QtNetwork" -I"C:/Program Files/msvc2017_64/include/QtCore" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" upgrade_protocol.h -o debug\moc_upgrade_protocol.cpp
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\upgrade_protocol.obj.4208.31.jom
                          upgrade_protocol.cpp
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\widget.obj.4208.47.jom
                          widget.cpp
                          	"C:\Program Files\msvc2017_64\bin\moc.exe" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include debug/moc_predefs.h -I"C:/Program Files/msvc2017_64/mkspecs/win32-msvc" -ID:/qtPro/ClientPro -ID:/GmSSL/include -I"C:/Program Files/msvc2017_64/include" -I"C:/Program Files/msvc2017_64/include/QtWidgets" -I"C:/Program Files/msvc2017_64/include/QtGui" -I"C:/Program Files/msvc2017_64/include/QtANGLE" -I"C:/Program Files/msvc2017_64/include/QtSerialPort" -I"C:/Program Files/msvc2017_64/include/QtNetwork" -I"C:/Program Files/msvc2017_64/include/QtCore" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" widget.h -o debug\moc_widget.cpp
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\moc_process_thread.obj.4208.328.jom
                          moc_process_thread.cpp
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\moc_upgrade_protocol.obj.4208.375.jom
                          moc_upgrade_protocol.cpp
                          main.cpp(10): warning C4189: “codec”: 局部变量已初始化但不引用
                          	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding /utf-8 -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\ClientPro.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\GmSSL\include -I"C:\Program Files\msvc2017_64\include" -I"C:\Program Files\msvc2017_64\include\QtWidgets" -I"C:\Program Files\msvc2017_64\include\QtGui" -I"C:\Program Files\msvc2017_64\include\QtANGLE" -I"C:\Program Files\msvc2017_64\include\QtSerialPort" -I"C:\Program Files\msvc2017_64\include\QtNetwork" -I"C:\Program Files\msvc2017_64\include\QtCore" -Idebug -I. -I\include -I"C:\Program Files\msvc2017_64\mkspecs\win32-msvc" -Fodebug\ @C:\Users\21443\AppData\Local\Temp\moc_widget.obj.4208.390.jom
                          moc_widget.cpp
                          upgrade_protocol.cpp(141): warning C4267: “初始化”: 从“size_t”转换到“uint16_t”,可能丢失数据
                          upgrade_protocol.cpp(180): warning C4189: “dataLength”: 局部变量已初始化但不引用
                          	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\ClientPro.exe @C:\Users\21443\AppData\Local\Temp\ClientPro.exe.4208.1453.jom
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm3_digest,函数 "private: class std::vector<unsigned char,class std::allocator<unsigned char> > __cdecl UpgradeProtocol::sm3Hash(class std::vector<unsigned char,class std::allocator<unsigned char> > const &)" (?sm3Hash@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBV23@@Z) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_point_from_octets,函数 "private: struct SM2_KEY __cdecl UpgradeProtocol::loadSM2PublicKeyFromData(class std::vector<unsigned char,class std::allocator<unsigned char> > const &)" (?loadSM2PublicKeyFromData@UpgradeProtocol@@AEAA?AUSM2_KEY@@AEBV?$vector@EV?$allocator@E@std@@@std@@@Z) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_key_generate,函数 "private: void __cdecl UpgradeProtocol::generateAndSaveSM2PrivateKey(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?generateAndSaveSM2PrivateKey@UpgradeProtocol@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_key_set_public_key,函数 "private: struct SM2_KEY __cdecl UpgradeProtocol::loadSM2PublicKeyFromData(class std::vector<unsigned char,class std::allocator<unsigned char> > const &)" (?loadSM2PublicKeyFromData@UpgradeProtocol@@AEAA?AUSM2_KEY@@AEBV?$vector@EV?$allocator@E@std@@@std@@@Z) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_private_key_to_pem,函数 "private: void __cdecl UpgradeProtocol::generateAndSaveSM2PrivateKey(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?generateAndSaveSM2PrivateKey@UpgradeProtocol@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_private_key_from_pem,函数 "private: struct SM2_KEY __cdecl UpgradeProtocol::loadSM2PrivateKey(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadSM2PrivateKey@UpgradeProtocol@@AEAA?AUSM2_KEY@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm2_encrypt,函数 "private: class std::vector<unsigned char,class std::allocator<unsigned char> > __cdecl UpgradeProtocol::sm2Encrypt(struct SM2_KEY const &)" (?sm2Encrypt@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBUSM2_KEY@@@Z) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm4_set_encrypt_key,函数 "private: void __cdecl UpgradeProtocol::generateSM4Key(void)" (?generateSM4Key@UpgradeProtocol@@AEAAXXZ) 中引用了该符号
                          upgrade_protocol.obj : error LNK2019: 无法解析的外部符号 sm4_cbc_encrypt,函数 "private: class std::vector<unsigned char,class std::allocator<unsigned char> > __cdecl UpgradeProtocol::sm4Encrypt(class std::vector<unsigned char,class std::allocator<unsigned char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > &)" (?sm4Encrypt@UpgradeProtocol@@AEAA?AV?$vector@EV?$allocator@E@std@@@std@@AEBV23@AEAV23@@Z) 中引用了该符号
                          debug\ClientPro.exe : fatal error LNK1120: 9 个无法解析的外部命令
                          jom: D:\qtPro\ClientPro\Makefile.Debug [debug\ClientPro.exe] Error 1120
                          jom: D:\qtPro\ClientPro\Makefile [debug] Error 2
                          10:04:43: 进程"D:\qt\Tools\QtCreator\bin\jom\jom.exe"退出,退出代码 2 。
                          Error while building/deploying project ClientPro (kit: Replacement for "Desktop Qt 5.11.1 MSVC2017 64bit")
                          When executing step "Make"
                          10:04:43: Elapsed time: 00:02.
                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #22

                          @hhhl01 said in undefined reference to &#x60;sm3_digest':

                          else:unix:!macx: LIBS += -L$$PWD/../../GmSSL/gmssl.lib

                          On Unix/Linux this is wrong.
                          Please check https://doc.qt.io/qt-6/qmake-variable-reference.html#libs

                          $$PWD/../../GmSSL/debug/gmssl.lib - is this path valid?
                          Are the missing functions part of the gmssl library?

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          H 1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @hhhl01 said in undefined reference to &#x60;sm3_digest':

                            else:unix:!macx: LIBS += -L$$PWD/../../GmSSL/gmssl.lib

                            On Unix/Linux this is wrong.
                            Please check https://doc.qt.io/qt-6/qmake-variable-reference.html#libs

                            $$PWD/../../GmSSL/debug/gmssl.lib - is this path valid?
                            Are the missing functions part of the gmssl library?

                            H Offline
                            H Offline
                            hhhl01
                            wrote on last edited by
                            #23

                            @jsulm This path is valid, I'm developing on windows platform, when I change it to the format below it doesn't work.

                            else:unix:!macx: LIBS += -L$$PWD/../../GmSSL/lib/ -lgmssl

                            jsulmJ 1 Reply Last reply
                            0
                            • H hhhl01

                              @jsulm This path is valid, I'm developing on windows platform, when I change it to the format below it doesn't work.

                              else:unix:!macx: LIBS += -L$$PWD/../../GmSSL/lib/ -lgmssl

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #24

                              @hhhl01 said in undefined reference to &#x60;sm3_digest':

                              when I change it to the format below it doesn't work

                              I didn't say you have to change it for Windows.

                              Again: "Are the missing functions part of the gmssl library?"
                              Was this library built using same compiler?

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              H 1 Reply Last reply
                              0
                              • jsulmJ jsulm

                                @hhhl01 said in undefined reference to &#x60;sm3_digest':

                                when I change it to the format below it doesn't work

                                I didn't say you have to change it for Windows.

                                Again: "Are the missing functions part of the gmssl library?"
                                Was this library built using same compiler?

                                H Offline
                                H Offline
                                hhhl01
                                wrote on last edited by
                                #25

                                @jsulm said in undefined reference to &#x60;sm3_digest':

                                Are the missing functions part of the gmssl library?

                                Yes, it is part of the library. And the library is constructed using the same compiler.

                                1 Reply Last reply
                                0
                                • O Offline
                                  O Offline
                                  OliverBacker64
                                  wrote on last edited by
                                  #26
                                  This post is deleted!
                                  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