sibojia / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

Some marco definitions are conflicting with other packages. #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Include logging.h after windows.h
2. Include logging.h atter UnitTest++.h

What is the expected output? What do you see instead?

I've just started using glog in my project. but there are some problems.
Some definition are conflicting with other header's definition.

For example, ERROR is defined in wingdi.h, CHECK is defined in UnitTest++.
I think the macro names are too general. 

What version of the product are you using? On what operating system?
Visual Studio C++ 2005, Win32, UnitTest++

Please provide any additional information below.

Original issue reported on code.google.com by picky...@gmail.com on 2 Apr 2009 at 12:34

GoogleCodeExporter commented 9 years ago
Yeah, I was aware of this issue. Maybe adding 'G' or something as the prefix 
character 
would solve this (e.g., GLOG(GERROR) << "foobar"). Of course, we would want to 
make 
this feature optional. This fix may take a while. For ERROR, if you are not 
using GDI 
actually,  please define a C macro NOGDI for the meantime.

Thanks,

Original comment by shinichi...@gmail.com on 7 Apr 2009 at 6:41

GoogleCodeExporter commented 9 years ago
I use patch below to eliminate this error and on Windows you should include the 
GLOG
library BEFORE any other library.

In my case I use the GLOG library after STL, but before boost.

Hope this helps

Original comment by lynxl...@gmail.com on 13 Apr 2010 at 10:43

Attachments:

GoogleCodeExporter commented 9 years ago
Yeah, I think this patch solves 80% of this issue. However, unfortunately, I 
think 
this patch won't work for some cases such as

int level = ERROR;  // ERROR will be replaced by 0
LOG_AT_LEVEL(level) << "foobar";

Original comment by shinichi...@gmail.com on 27 May 2010 at 1:40

GoogleCodeExporter commented 9 years ago
Issue 33 has been merged into this issue.

Original comment by shinichi...@gmail.com on 28 May 2010 at 3:23