Qt error when using dmctk

Error 1:

error LNK2001: Unresolved external symbol __imp__OpenProcessToken@12
error LNK2001: Unresolved external symbol __imp__LookupPrivilegeValueA@12
error LNK2001: Unresolved external symbol __imp__AdjustTokenPrivileges@24
error LNK2001: Unresolved external symbol __imp__OpenSCManagerA@12
error LNK2001 : Unresolved external symbol __imp__CloseServiceHandle@4
error LNK2001: Unresolved external symbol __imp__OpenServiceA@12
error LNK2001: Unresolved external symbol __imp__QueryServiceStatus@8
error LNK2001: Unresolved external symbol __imp__ControlService@12
error LNK2001: Unresolved Resolved external symbol __imp__DeleteService@4
error LNK2001: Unresolved external symbol __imp__CreateServiceA@52
error LNK2001: Unresolved external symbol __imp__StartServiceA@12
error LNK2001: Unresolved external symbol __imp__RegOpenKeyExA@20
error LNK2001: Unresolved External symbol __imp__RegQueryValueExA@24
error LNK2001: Unresolved external symbol __imp__RegCloseKey@4
error LNK2001: Unresolved external symbol __imp__RegCreateKeyA@12
error LNK2001: Unresolved external symbol __imp__RegCreateKeyExA@36
error LNK2001: Unresolved external symbol __imp__RegSetValueExA@24
error LNK2001 : Unresolved external symbol __imp__RegEnumKeyA@16
error LNK2001: Unresolved external symbol __imp__RegDeleteKeyA@8
error LNK2001: Unresolved external symbol __imp__RegDeleteValueA@8
error LNK2001: Unresolved external symbol __imp__RegQueryInfoKeyA@48
error LNK2001: Unresolved Resolved external symbol __imp__RegEnumKeyExA@32

Reason:
The compilation option of the original program is: use the standard windows library, when it is changed to use MFC in the static library, the above error occurs

Solution: increase the Advapi32.lib library

Error 2: LNK2019 unresolved external symbol __imp_WSARecv


Error LNK2019 Unresolved external symbol __imp_WSARecv, the symbol is in the function "public: bool __cdecl CTCPByteSession::Receive(void)" (?Receive@CTCPByteSession@@QEAA_NXZ) 

Error LNK2019 Unresolved external symbol __imp_socket, the symbol is in the function "public: static int __cdecl CTCPConnector::ConnectTo(int,int,int,int,int)" (?ConnectTo@CTCPConnector@@SAHHHHH@Z) 

Error LNK2019 Unresolved external symbol __imp_setsockopt, the symbol is in the function "public: static int __cdecl CTCPConnector::ConnectTo(int,int,int,int,int)" (?ConnectTo@CTCPConnector@@SAHHHHHH@Z) 

Error LNK2019 Unresolved external symbol __imp_send, the symbol is in the function "public: virtual int __cdecl CTCPByteSession::CTCPByteBackScroll::BackGo(class CByteBuffer &)" (?BackGo@CTCPByteBackScroll@CTCPByteSession@@UEAAHAEAVCByteBuffer@@@Z) 

Error LNK2019 Unresolved external symbol __imp_inet_addr, the symbol is in the function "public: bool __cdecl CBombClient::ConnectTo(char const *,int,int)" (?ConnectTo@CBombClient@@QEAA_NPEBDHH@Z) 

Error LNK2019 Unresolved external symbol __imp_htons, the symbol is in the function "public: bool __cdecl CTCPCompleteCenter::AttachSocket(int,int)" (?AttachSocket@CTCPCompleteCenter@@QEAA_NHH@Z) 
Solution:

Add ws2_32.lib library

Error 3: Unresolved external symbol _GetAdaptersInfo@8

Localhost.obj: error LNK2019: Unresolved external symbol _GetAdaptersInfo@8, the symbol is referenced in the function "void __cdecl GetLocalAdapterInfo(void)" (?GetLocalAdapterInfo@@YAXXZ)

1>J:\mfc dll\lanscannerdlg\Debug\lanscannerdlg.exe: fatal error LNK1120: 1 external command that cannot be parsed
Solution: add iphlpapi.lib (#pragma comment(lib,"iphlpapi.lib"))

Guess you like

Origin blog.csdn.net/a8039974/article/details/108320613