undefined reference to `sm3_digest'
-
@JonB I also need to explain that my current development environment is the windows platform.
And the external library I linked to is 64-bit.
I think there is no problem with my build environment, so is it possible that the Windows platform is causing this error? -
-
@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.
-
@hhhl01 said in undefined reference to `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? -
@hhhl01 said in undefined reference to `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? -
This post is deleted!