error LNK2019: 无法解析的外部符号 freeReplyObject,该符号在函数 "private: void __cdecl ccx::Redis::freeReply(void)"

1>redis.obj : error LNK2019: 无法解析的外部符号 freeReplyObject,该符号在函数 "private: void __cdecl ccx::Redis::freeReply(void)" (?freeReply@Redis@ccx@@AEAAXXZ) 中被引用
1>redis.obj : error LNK2019: 无法解析的外部符号 redisConnect,该符号在函数 "public: void __cdecl ccx::Redis::Connect(void)" (?Connect@Redis@ccx@@QEAAXXZ) 中被引用
1>redis.obj : error LNK2019: 无法解析的外部符号 redisFree,该符号在函数 "public: void __cdecl ccx::Redis::disConnect(void)" (?disConnect@Redis@ccx@@QEAAXXZ) 中被引用
1>redis.obj : error LNK2019: 无法解析的外部符号 redisCommand,该符号在函数 "private: void __cdecl ccx::Redis::getString(class std::basic_string,class std::allocator > const &)" (?getString@Redis@ccx@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
1>hiredis.lib(hiredis.obj) : error LNK2019: 无法解析的外部符号 _strerror_r,该符号在函数 ___redisSetError 中被引用
1>hiredis.lib(net.obj) : error LNK2001: 无法解析的外部符号 _strerror_r
1>hiredis.lib(net.obj) : error LNK2019: 无法解析的外部符号 _replace_setsockopt,该符号在函数 _redisContextSetTimeout 中被引用

解决办法:不用隐式调用,改用显示调用。

#pragma comment(lib, "hiredis.lib")
#pragma comment(lib, "Win32_Interop.lib")

 

 

1>Win32_Interopd.lib(Win32_ANSI.obj) : error LNK2019: 无法解析的外部符号 __imp_wsprintfW,该符号在函数 InterpretEscSeq 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_DeregisterEventSource,该符号在函数 "public: void __cdecl RedisEventLog::LogMessage(char const *,unsigned short)" (?LogMessage@RedisEventLog@@QEAAXPEBDG@Z) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_RegisterEventSourceA,该符号在函数 "public: void __cdecl RedisEventLog::LogMessage(char const *,unsigned short)" (?LogMessage@RedisEventLog@@QEAAXPEBDG@Z) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_ReportEventA,该符号在函数 "public: void __cdecl RedisEventLog::LogMessage(char const *,unsigned short)" (?LogMessage@RedisEventLog@@QEAAXPEBDG@Z) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_RegCloseKey,该符号在函数 "public: __cdecl SmartRegistryHandle::~SmartRegistryHandle(void)" (??1SmartRegistryHandle@@QEAA@XZ) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_RegCreateKeyA,该符号在函数 "public: void __cdecl RedisEventLog::InstallEventLogSource(class std::basic_string,class std::allocator >)" (?InstallEventLogSource@RedisEventLog@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_RegDeleteKeyA,该符号在函数 "public: void __cdecl RedisEventLog::UninstallEventLogSource(void)" (?UninstallEventLogSource@RedisEventLog@@QEAAXXZ) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_RegOpenKeyA,该符号在函数 "public: void __cdecl RedisEventLog::InstallEventLogSource(class std::basic_string,class std::allocator >)" (?InstallEventLogSource@RedisEventLog@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_RegQueryValueExA,该符号在函数 "public: void __cdecl RedisEventLog::InstallEventLogSource(class std::basic_string,class std::allocator >)" (?InstallEventLogSource@RedisEventLog@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
1>Win32_Interopd.lib(Win32_EventLog.obj) : error LNK2019: 无法解析的外部符号 __imp_RegSetValueExA,该符号在函数 "public: void __cdecl RedisEventLog::InstallEventLogSource(class std::basic_string,class std::allocator >)" (?InstallEventLogSource@RedisEventLog@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用

解决办法:调用psapi.lib库

你可能感兴趣的:(c++,c,windows)