C++ 错误:名称后跟“::”必须是类或命名空间名称

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22922523/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 00:16:40  来源:igfitidea点击:

error: name followed by '::' must be a class or namespace name

c++

提问by Lucie kulza

I'm trying to build my first ATL DLL project, in which I'm using ADODB. The issue here is that I'm getting each ADODB class underlined

我正在尝试构建我的第一个 ATL DLL 项目,在该项目中我使用了 ADODB。这里的问题是我给每个 ADODB 类都加了下划线

ADODB::_ConnectionPtr spADOConnection;

when I pass the mouse over on ADODB::_ConnectionPtrI get name followed by '::' must be a class or namespace namespADOConnectionI get expected a ';'. What's the mean of this, please? How do I to fix it please?

当我通过鼠标悬停在ADODB::_ConnectionPtr我得到name followed by '::' must be a class or namespace namespADOConnection我得到expected a ';'。请问这是什么意思?请问我该如何解决?

Thanks a lot!

非常感谢!

回答by legends2k

The compiler is unable to locate the declaration of ADODB. Make sure you include the relevant header in the translation unit where the compiler complains.

编译器无法定位 的声明ADODB。确保在编译器抱怨的翻译单元中包含相关标题。