Borland C++:与 std 不明确(错误 E2015)
我一直在 Visual Studio 2005 中开发一个 DLL。目前它可以编译并执行其预期的操作。
然而,我想使用 Borland C++ 2006 来编译它,因为我听说它更好并且可以生成更快的代码。 当我尝试这样做时,我收到如下错误消息:
E2015 strcmp(const char *,const char *) 和之间存在歧义 std::strcmp(const char *,const char *)
我已将 strcmp 的每个实例更改为 std::strcmp 以解决歧义问题并且它有效,但我想知道是否有更聪明的方法来做这个。
谢谢 :-)
I've been developing a DLL in Visual Studio 2005. At the moment it compiles and does what it's supposed to.
However, I wanted to compile it using Borland C++ 2006 because I've heard that is better and makes faster code. When I try to do it I get error messages like this one:
E2015 Ambiguity between strcmp(const char *,const char *) and
std::strcmp(const char *,const char *)
I've changed every instance of strcmp to std::strcmp to solve the ambiguity problem and it works but I wonder if there is a smarter way to make this.
Thank you :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能有
and
和 a
您的代码中 。 cstring 声明 std::strcmp,string.h 声明 strcmp。 这导致了歧义。 如果您可以避免执行所有这三件事,那么您的问题可能就会得到解决。
You probably have
and
and a
in your code somewhere. cstring declares std::strcmp, and string.h declares strcmp. That is causing the ambiguity. If you could avoid doing all 3 of these things, that would probably take care of your problem.