You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Jeff Lynn <jm...@yahoo.com> on 2004/12/06 18:45:22 UTC

How do you resolve 'ostream' ambiguous symbol error?

Hi,
 
Can someone help me by pointing out what need to be done to resolve the following error when I declared log4cxx name space inside the header file of a C++ class?
 
   D:\VisualStudio\VC98\INCLUDE\ios.h(159) : error C2872: 'ostream' : ambiguous symbol
 
I can declare and use LoggerPtr as global variable in the C++ file, yet when declared inside a C++ header file, got the above error.
 
I would like to declare the LoggerPtr instance as a member variable of each class instead of as a global variable.
 
Thanks!
 
jml


		
---------------------------------
Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.

Re: How do you resolve 'ostream' ambiguous symbol error?

Posted by Curt Arnold <ca...@apache.org>.
You may need to remove any "namespace log4cxx" and use 
"log4cxx::LoggerPtr" to declare your logger reference.  By removing the 
"namespace log4cxx", you will eliminate the ambiguity between 
log4cxx::ostream and std::ostream.


On Dec 6, 2004, at 11:45 AM, Jeff Lynn wrote:

> Hi,
>  
> Can someone help me by pointing out what need to be done to resolve 
> the following error when I declared log4cxx name space inside the 
> header file of a C++ class?
>  
>    D:\VisualStudio\VC98\INCLUDE\ios.h(159) : error C2872: 'ostream' : 
> ambiguous symbol
>  
> I can declare and use LoggerPtr as global variable in the C++ file, 
> yet when declared inside a C++ header file, got the above error.
>  
> I would like to declare the LoggerPtr instance as a member variable of 
> each class instead of as a global variable.