VS2010 errors when including base/cef_logging.h

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

VS2010 errors when including base/cef_logging.h

Postby Czarek » Tue Nov 25, 2014 9:24 am

Tried to update my app to latest CEF branch 2171 revision 1902 and got these errors while compiling in VS2010:

Code: Select all
cef\include/base/cef_logging.h(180): warning C4091: '' : ignored on left of 'const int' when no variable is declared
1>cef\include/base/cef_logging.h(180): error C2143: syntax error : missing ';' before 'if'
1>cef\include/base/cef_logging.h(180): error C2059: syntax error : 'if'
1>cef\include/base/cef_logging.h(180): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(180): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(181): warning C4091: '' : ignored on left of 'const int' when no variable is declared
1>cef\include/base/cef_logging.h(181): error C2143: syntax error : missing ';' before 'if'
1>cef\include/base/cef_logging.h(181): error C2059: syntax error : 'if'
1>cef\include/base/cef_logging.h(181): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(181): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(182): warning C4091: '' : ignored on left of 'const int' when no variable is declared
1>cef\include/base/cef_logging.h(182): error C2143: syntax error : missing ';' before 'if'
1>cef\include/base/cef_logging.h(182): error C2059: syntax error : 'if'
1>cef\include/base/cef_logging.h(182): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(182): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(188): error C2059: syntax error : 'if'
1>cef\include/base/cef_logging.h(188): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(188): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(234): error C2059: syntax error : 'if'
1>cef\include/base/cef_logging.h(234): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(234): error C2059: syntax error : 'else'
1>cef\include/base/cef_logging.h(265): warning C4005: 'LOG' : macro redefinition
1>          c:\phpdesktop\phpdesktop-chrome-cef2171\log.h(144) : see previous definition of 'LOG'
1>cef\include/base/cef_logging.h(491): error C2039: 'LOG_logINFO' : is not a member of 'cef::logging'
1>cef\include/base/cef_logging.h(491): error C2065: 'LOG_logINFO' : undeclared identifier
1>cef\include/base/cef_logging.h(491): error C2039: 'LogMessageVoidify' : is not a member of 'cef::logging'
1>cef\include/base/cef_logging.h(491): error C2065: 'COMPACT_GOOGLE_LOG_logINFO' : undeclared identifier
1>cef\include/base/cef_logging.h(491): error C2228: left of '.stream' must have class/struct/union
1>          type is ''unknown-type''
1>cef\include/base/cef_logging.h(491): error C3861: 'LogMessageVoidify': identifier not found


I already have LOG_INFO (LOG_WARNING, etc) defines in my logging library and it conflicts with CEF. How about changing it to CEF_LOG_INFO to avoid conflicts? Changing its name in my app probably not a good idea, as it already occurs in hundreds of places.

UPDATE.
"LOG" macro conflicts as well:

Code: Select all
cef\include/base/cef_logging.h(265): warning C4005: 'LOG' : macro redefinition
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: VS2010 errors when including base/cef_logging.h

Postby magreenblatt » Tue Nov 25, 2014 12:19 pm

Czarek wrote:I already have LOG_INFO (LOG_WARNING, etc) defines in my logging library and it conflicts with CEF. How about changing it to CEF_LOG_INFO to avoid conflicts? Changing its name in my app probably not a good idea, as it already occurs in hundreds of places.

Why not use the CEF versions? It will then integrate with CEF's existing logging capabilities.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: VS2010 errors when including base/cef_logging.h

Postby Czarek » Tue Nov 25, 2014 12:30 pm

magreenblatt wrote:Why not use the CEF versions? It will then integrate with CEF's existing logging capabilities.

I might do this in the future, but right now it works fine, so I didn't feel like refactoring many files. It was easier to rename LOG macro and several of the constants in cef :)
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: VS2010 errors when including base/cef_logging.h

Postby gprosch » Thu Sep 03, 2015 3:08 pm

The use of LOG causes issues in my application as well since I have a LOG macro. Using a CEF prefix for this macro would be a good thing.
gprosch
Newbie
 
Posts: 4
Joined: Fri Jul 31, 2015 10:09 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 56 guests