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