VS中google库目录配置成功,但仍出现链接错误

VS中google库目录配置成功,但仍出现链接错误

Detector.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: __thiscall google::LogMessageFatal::~LogMessageFatal(void)” (_imp??1LogMessageFatal@google@@QAE@XZ)
1>Detector.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: __thiscall google::LogMessageFatal::LogMessageFatal(char const *,int)” (_imp??0LogMessageFatal@google@@QAE@PBDH@Z)
1>Detector.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: class std::basic_ostream & __thiscall google::LogMessage::stream(void)” (_imp?stream@LogMessage@google@@QAEAAV? b a s i c o s t r e a m @ D U ? basic_ostream@DU? basicostream@DU?char_traits@D@std@@@std@@XZ)
1>Detector.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: void __thiscall google::LogMessageVoidify::operator&(class std::basic_ostream &)” (_imp??ILogMessageVoidify@google@@QAEXAAV? b a s i c o s t r e a m @ D U ? basic_ostream@DU? basicostream@DU?char_traits@D@std@@@std@@@Z)
1>Detector.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: __thiscall google::LogMessageVoidify::LogMessageVoidify(void)” (_imp??0LogMessageVoidify@google@@QAE@XZ)
1>GradientCalculator.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: __thiscall google::LogMessage::~LogMessage(void)” (_imp??1LogMessage@google@@QAE@XZ)
1>GradientCalculator.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: __thiscall google::LogMessage::LogMessage(char const *,int,int)” (_imp??0LogMessage@google@@QAE@PBDHH@Z)
1>ProtobufIO.obj : error LNK2001: 无法解析的外部符号 “__declspec(dllimport) public: class std::basic_string * __thiscall google::base::CheckOpMessageBuilder::NewString(void)” (_imp?NewString@CheckOpMessageBuilder@base@google@@QAEPAV? b a s i c s t r i n g @ D U ? basic_string@DU? basicstring@DU?char_traits@D@std@@V?KaTeX parse error: Expected group after '_' at position 70: …01: 无法解析的外部符号 "_̲_declspec(dllim…basic_ostream@DU?KaTeX parse error: Expected group after '_' at position 75: …01: 无法解析的外部符号 "_̲_declspec(dllim…basic_ostream@DU?$char_traits@D@std@@@std@@XZ)

解决方案:
工程-属性-C/C++
预处理器定义加上GOOGLE_GLOG_DLL_DECL=

你可能感兴趣的:(VS中google库目录配置成功,但仍出现链接错误)