Home > ambiguous symbol > ambiguous symbol error

Ambiguous Symbol Error

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers

Error C2872 Istream Ambiguous Symbol

or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x font ambiguous symbol Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it

Idataobject Ambiguous Symbol

only takes a minute: Sign up getting error for ambiguous symbol and need help to remove it up vote 1 down vote favorite 1 i am getting this error which i unable to remove in visual studio 2010. i error c2872 'iserviceprovider' ambiguous symbol am using one third party library which uses its own definition for "string" Also visual studio's xstring file is there in the folder where it gets installed. now when i am trying to compile code i am getting following error 1>...\xyz.cpp(24): error C2872: 'string' : ambiguous symbol 1> could be 'third party library path\string.h(31) 1> or 'c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring(2063) : std::string' compiler is not able to understand which string definition it should use. How can i remove error c2872 ambiguous symbol c++ this error in visual studi 2010. I want the code to use third party string definition. i tried to set third party path in include directory but still i am seeing this error. Please help me. Thanks in advance c++ share|improve this question asked Feb 20 '12 at 11:27 novice 19137 Use std::string instead of just string? –BoBTFish Feb 20 '12 at 11:30 @BoBTFish "I want the code to use third party string definition." ;) –user1203803 Feb 20 '12 at 11:31 add a comment| 5 Answers 5 active oldest votes up vote 5 down vote This is an example of a namespace clash. You probably have in your code: #include <3rdPartyString.h> // declaration of 3rd party string type #include // declaration of std::string using namespace 3rdPartyNamespace; using namespace std; ... string myStr; // which string type? Compiler now doesn't know which string you want to use - one from 3rd party library or STL one. You can resolve this ambiguity by prepending namespace name to the type: 3rdPartyNamespace::string myStr; // if you want to use string from 3rd party library or std::string myStr; // if you want to use STL string Never place using namespace namespace_name; in headers but try to avoid it in source files as well. The best practice is to prepend type name as this does doesn't pollute your current namespace with the other one thus avoiding namespace clashes. s

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with

Ambiguous Symbol Definition

us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack ambiguous symbol namespace Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign

Shared_ptr Ambiguous Symbol

up What can cause ambiguous symbol errors on one computer and not another? up vote 1 down vote favorite I'm using Visual Studio 2010 to work on C++ code. The project and all its contents have been written by someone else, and http://stackoverflow.com/questions/9360375/getting-error-for-ambiguous-symbol-and-need-help-to-remove-it copied onto a shared drive. When the creator builds it on his computer, it works fine. When I try to build the solution, I get a whole bunch of these errors error C2872: '' : ambiguous symbol could be '[File].cpp(66) : anonymous-namespace'::' or '[Different file].h(549) : `anonymous-namespace'::'. Here's an example of a line which is said to be in error: std::pair> b) -> bool { return (a.second.second < b.second.second ); }); It seems like the error always occurs with a line which http://stackoverflow.com/questions/10079230/what-can-cause-ambiguous-symbol-errors-on-one-computer-and-not-another ends in '});'. The full code is rather enormous to show here, and it works on other computers, so presumably it's a problem with my settings or something. Can anybody hazard a guess as to what they may be? c++ visual-studio-2010 compiler-errors share|improve this question edited Apr 10 '12 at 0:09 Hans Passant 652k809491597 asked Apr 9 '12 at 20:15 Fish 4016 Check ANSI codepage. –Joshua Apr 9 '12 at 20:16 1 does your compiler support c++11? –juanchopanza Apr 9 '12 at 20:20 2 Same patch level for VS? –0xC0000022L Apr 9 '12 at 20:36 Thanks, STATUS_ACCESS_DENIED (and juanchopanza - that helped me figure out what a lambda was). It turns out to have been a problem with my version - I was missing the patch that fixed this bug. –Fish Apr 10 '12 at 18:06 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote Not sure if you've seen this or not but according to MSDN page for that compiler error: C2872 can occur if a header file includes a using Directive (C++), and a subsequent header file is #include'd and contains a type that is also in the namespace specified in the using directive. Specify a using directive only after all your header files are specified with #include. MSDN Page share|improve this answer answered Apr 10 '12 at 0:17 Tom 1,27332043 add a comment| up vote 0 down vote I have had the same issue wi

resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers https://msdn.microsoft.com/en-us/library/t57wswcs.aspx Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++ Build Errors Compiler Errors C2800 Through C2899 Compiler Errors https://www.gidforums.com/t-4512.html C2800 Through C2899 Compiler Error C2872 Compiler Error C2872 Compiler Error C2872 Compiler Error C2800 Compiler Error C2801 Compiler Error C2802 Compiler Error C2803 Compiler Error C2804 Compiler Error C2805 Compiler Error ambiguous symbol C2806 Compiler Error C2807 Compiler Error C2808 Compiler Error C2809 Compiler Error C2810 Compiler Error C2811 Compiler Error C2812 Compiler Error C2813 Compiler Error C2814 Compiler Error C2815 Compiler Error C2817 Compiler Error C2818 Compiler Error C2819 Compiler Error C2821 Compiler Error C2823 Compiler Error C2824 Compiler Error C2825 Compiler Error C2827 Compiler Error C2828 Compiler Error C2829 Compiler Error C2830 Compiler Error C2831 Compiler ambiguous symbol error Error C2833 Compiler Error C2834 Compiler Error C2835 Compiler Error C2838 Compiler Error C2839 Compiler Error C2842 Compiler Error C2843 Compiler Error C2844 Compiler Error C2845 Compiler Error C2846 Compiler Error C2847 Compiler Error C2849 Compiler Error C2850 Compiler Error C2854 Compiler Error C2855 Compiler Error C2856 Compiler Error C2857 Compiler Error C2858 Compiler Error C2859 Compiler Error C2860 Compiler Error C2861 Compiler Error C2862 Compiler Error C2863 Compiler Error C2864 Compiler Error C2865 Compiler Error C2867 Compiler Error C2868 Compiler Error C2869 Compiler Error C2870 Compiler Error C2871 Compiler Error C2872 Compiler Error C2873 Compiler Error C2874 Compiler Error C2875 Compiler Error C2876 Compiler Error C2877 Compiler Error C2878 Compiler Error C2879 Compiler Error C2881 Compiler Error C2882 Compiler Error C2883 Compiler Error C2884 Compiler Error C2885 Compiler Error C2886 Compiler Error C2888 Compiler Error C2890 Compiler Error C2891 Compiler Error C2892 Compiler Error C2893 Compiler Error C2894 Compiler Error C2896 Compiler Error C2897 Compiler Error C2898 Compiler Error C2899 TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. Compil

Thread Tools Search this Thread Rate Thread #1 07-Jan-2005, 15:24 small_ticket Junior Member Join Date: May 2004 Posts: 45 What is "Ambigious symbol" ??*( a compilation error) Here is some code: CPP / C++ / C Code:

 void Interpreter :: read ( char *filename ) { ifstream inClientFile ( filename , ios::in ); //exitprogram if ifstream could not open file  if(!inClientFile ) { cerr << "File could not be opened" <1); } char lineNo[2]; char *string1; char  string[80]; //display each line  while(inClientFile.getline(string,80)){ for(int i=0;i<2;i++) //strtok da kullanlabilir...  lineNo[i]=string[i]; int y = atoi (lineNo); string1=&string[3]; listObject.insert(string1,y); //cout<< string1 << "\n";  } } 
and here are the errors: Code: c:\program files\microsoft visual studio\vc98\include\ios.h(146) : error C2872: 'streambuf' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\ios.h(159) : error C2872: 'ostream' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\ios.h(159) : error C2872: 'ostream' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\ios.h(160) : error C2872: 'ostream' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\ios.h(180) : error C2872: 'streambuf' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\ios.h(207) : error C2872: 'streambuf' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\ios.h(210) : error C2872: 'streambuf' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\ios.h(219) : error C2872:

 

Related content

ambiguous symbol error c2872

Ambiguous Symbol Error C table id toc tbody tr td div id toctitle Contents div ul li a href Error C filetime Ambiguous Symbol a li li a href Error C idataobject Ambiguous Symbol a li li a href Error C string Ambiguous Symbol a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more relatedl about Stack Overflow the company Business Learn more about hiring developers error c dword ambiguous symbol

error 1 error c2872 ambiguous symbol

Error Error C Ambiguous Symbol table id toc tbody tr td div id toctitle Contents div ul li a href Ambiguous Symbol Visual Studio a li li a href C Ambiguous Symbol Namespace a li li a href Error C string Ambiguous Symbol a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to relatedl any questions you might have Meta Discuss the ambiguous symbol definition workings and policies of this site About Us Learn more about Stack p h id Ambiguous Symbol Visual Studio p Overflow the company Business

error 2 error c2872 ambiguous symbol

Error Error C Ambiguous Symbol table id toc tbody tr td div id toctitle Contents div ul li a href Error C string Ambiguous Symbol a li li a href Ambiguous Symbol Visual Studio a li li a href C Ambiguous Symbol Namespace a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more relatedl about Stack Overflow the company Business Learn more about hiring developers or ambiguous symbol definition posting ads

error 2872

Error table id toc tbody tr td div id toctitle Contents div ul li a href C Corral a li li a href Error C cdialogimpl Ambiguous Symbol a li li a href Ambiguous Symbol Definition a li ul td tr tbody table p games PC games error c ambiguous symbol c Windows games Windows phone games Entertainment All Entertainment error c string ambiguous symbol Movies TV Music Business Education Business Students educators p h id C Corral p Developers Sale Sale Find a store Gift cards Products Software services Windows Office Free downloads security Internet p h id Error

error c2872 ambiguous symbol

Error C Ambiguous Symbol table id toc tbody tr td div id toctitle Contents div ul li a href Error C string Ambiguous Symbol a li li a href Ambiguous Symbol Definition a li li a href Ambiguous Symbol Visual Studio a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this relatedl site About Us Learn more about Stack Overflow the company Business error c dword ambiguous symbol Learn more about hiring developers or posting ads

error c2872 ambiguous

Error C Ambiguous table id toc tbody tr td div id toctitle Contents div ul li a href Error C filetime Ambiguous Symbol a li li a href Error C string Ambiguous Symbol a li li a href Error C iserviceprovider Ambiguous Symbol a li li a href Ambiguous Symbol Definition a li ul td tr tbody table p resources Windows Server resources Programs MSDN subscriptions Overview Benefits relatedl Administrators Students Microsoft Imagine Microsoft Student Partners error c dword ambiguous symbol ISV Startups TechRewards Events Community Magazine Forums Blogs Channel p h id Error C filetime Ambiguous Symbol p Documentation

error c2872 ambiguous symbol namespace

Error C Ambiguous Symbol Namespace table id toc tbody tr td div id toctitle Contents div ul li a href C Ambiguous Symbol Namespace a li li a href Error C Ambiguous Symbol Visual C a li li a href C Error C a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the relatedl workings and policies of this site About Us Learn more ambiguous symbol definition about Stack Overflow the company Business Learn more about hiring developers or posting error

error symbol is ambiguous

Error Symbol Is Ambiguous table id toc tbody tr td div id toctitle Contents div ul li a href Error C iserviceprovider Ambiguous Symbol a li li a href Error C Ambiguous Symbol C a li li a href Ambiguous Symbol Definition a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more relatedl about Stack Overflow the company Business Learn more about hiring developers or error c ambiguous symbol posting ads

idataobject ambiguous symbol error

Idataobject Ambiguous Symbol Error table id toc tbody tr td div id toctitle Contents div ul li a href Error C Ambiguous Symbol a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to relatedl any questions you might have Meta Discuss the iserviceprovider ambiguous symbol servprov h workings and policies of this site About Us Learn more about Stack cannot use this indirection on type iserviceprovider Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs error c filetime ambiguous symbol

iserviceprovider error

Iserviceprovider Error table id toc tbody tr td div id toctitle Contents div ul li a href Error C filetime Ambiguous Symbol a li li a href Error C Ambiguous Symbol a li li a href System string To Std string a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and relatedl policies of this site About Us Learn more about Stack c cli iserviceprovider ambiguous symbol Overflow the company Business Learn more about hiring developers or posting ads

iserviceprovider ambiguous symbol error

Iserviceprovider Ambiguous Symbol Error table id toc tbody tr td div id toctitle Contents div ul li a href Iserviceprovider Ambiguous Symbol Servprov H a li li a href Error C filetime Ambiguous Symbol a li li a href System string To Std string a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might relatedl have Meta Discuss the workings and policies of this p h id Iserviceprovider Ambiguous Symbol Servprov H p site About Us Learn more about Stack Overflow the company Business Learn