'关键字'不是命名空间名称 [英] 'Keywords' is not a namespace-name

查看:217
本文介绍了'关键字'不是命名空间名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个不错的Java / C#程序员与C ++ / PoCo。

I'm a half decent Java/C# programmer struggling with C++/PoCo.

我所看到的所有例子都有相同的行。
使用命名空间Poco :: Data :: Keywords;
在QT中,关键字部分为黑色。我不知道#include如果这将解决它。代码块也失败,同样的错误=>'关键字'不是命名空间名称

All the examples I have seen so far have the same line. using namespace Poco::Data::Keywords; In QT, the "Keywords" part is black. I don't know what to "#include" if that would fix it. Codeblocks also fails with the same error => 'Keywords' is not a namespace-name

一个小例子:

#include <Poco/Format.h>
#include <Poco/Data/MySQL/MySQLException.h>
#include <Poco/Data/Session.h>
#include <Poco/Data/MySQL/Connector.h>
using namespace Poco::Data::Keywords;

int main(int argc, char** argv){
    return 0;
}

我在几台电脑上试过。现在一个是Ubuntu 15.10,更新并与以下包(包括libpoco)+ MySQL客户端/服务器/工作台。

I have tried this on a couple of computers. Present one is an Ubuntu 15.10, updated and with the following packages (includes libpoco) + MySQL Client/Server/Workbench.

    1  sudo apt-get install build-essential 
    2  sudo apt-get install qtbase5-dev qtbase5-dev-tools qtbase5-doc   qtbase5-doc-html qtbase5-examples qtbase5-examples-dbg
    3  sudo apt-get install qt5-default qt5-doc-html qt5-doc
    4  sudo apt-get install openssl libssl-dev libssl-doc 
    5  sudo apt-get install libpoco-dev


推荐答案

也许您的图书馆版本比您使用的实际文件的版本更旧。
尝试此命令查找版本:

Maybe your library version is older then the one from actual docs you are using. Try this command to find the version:

grep "POCO_VERSION" /usr/include/Poco/*.h

对我来说,它输出:

/usr/include/Poco/Foundation.h:#define POCO_VERSION 0x01030600

这意味着poco只有1.3(它没有关键字命名空间),而不是1.5(它有它)。

Which mean that poco is only 1.3 ( which does not have Keywords namespace yet ) and not 1.5 ( which does have it ).

如果你需要最新的Poco,你可以下载并手动安装,不使用apt。

If you need latest Poco you can download and install it manually, not using apt.

这篇关于'关键字'不是命名空间名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆