error: 'LOG_TAG' macro redefined


Android build error:

frameworks/native/services/inputflinger/EventHub.cpp:34:9: error: 'LOG_TAG' macro redefined [-Werror,-Wmacro-redefined]
#define LOG_TAG "EventHub"
        ^
system/core/liblog/include/log/log.h:51:9: note: previous definition is here
#define LOG_TAG NULL
        ^

AuthBlog:秋城https://www.cnblogs.com/houser0323

Solution

1.Use #undef
look this : 去除使用log时的警告信息:"LOG_TAG" redefined 的方法

#ifdef LOG_TAG
#undef LOG_TAG
#define LOG_TAG "EventHub"
#endif

2.Change order
first : #define and after that : #include

#define LOG_TAG "EventHub"
 ... 
#include<utils/CallStack.h> 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM