阅读 57

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如何采用静态链接的方式呢?

  1. 在自定义工程中添加GOOGLE_GLOG_DLL_DECL=,此宏才是使用静态链接库时必须的!
  2. GLOG_NO_ABBREVIATED_SEVERITIES这两个宏,第二个宏主要是为了避免与windows.h冲突(下面会讲到),

参考

原文:https://www.cnblogs.com/flyinggod/p/14829984.html

文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐