glog Windows Visual Studio 2013 编译项目
glog 基本使用
静态链接glog.lib库
1. Error C1189#error: ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h.
See the document for detail.gameserverd:\mycode\code\glog\src\windows\glog\log_severity.h55
2. Error LNK2019unresolved external symbol "__declspec(dllimport) public: __thiscall google::LogMessage::LogMessage(char const *,int)"
(__imp_??0LogMessage@google@@QAE@PBDH@Z) referenced in function "private: void __thiscall MainFrame::OnHello(class wxCommandEvent &)"
(?OnHello@MainFrame@@AAEXAAVwxCommandEvent@@@Z) gameserver D:\mycode\code\gameserver\main.obj1
glog如何采用静态链接的方式呢?
- 在自定义工程中添加
GOOGLE_GLOG_DLL_DECL=
,此宏才是使用静态链接库时必须的! GLOG_NO_ABBREVIATED_SEVERITIES
这两个宏,第二个宏主要是为了避免与windows.h
冲突(下面会讲到),