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
error: name followed by '::' must be a class or namespace name
提问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::_ConnectionPtr
I get name followed by '::' must be a class or namespace name
spADOConnection
I 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 name
spADOConnection
我得到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
。确保在编译器抱怨的翻译单元中包含相关标题。