Borland C ++: Ambiguity with std (error E2015)
I am developing a DLL in Visual Studio 2005. At the moment it compiles and does what it should.
However, I wanted to compile it with Borland C ++ 2006 because I heard it is better and makes the code faster. When I try to do this, I get error messages like this:
E2015 Ambiguity between strcmp (const char *, const char *) and std :: strcmp (const char *, const char *)
I've changed each strcmp instance to std :: strcmp to solve the ambiguity problem and it works, but I'm wondering if there is a smarter way to do this.
Thank: -)
source to share
You probably have
#include <cstring>
and
#include <string.h>
and a
using namespace std;
in your code somewhere. cstring declares std :: strcmp and string.h declares strcmp. This causes confusion. If you could avoid all three of these things, this will probably take care of your problem.
source to share