Arduino的:可以在鲍导入库,但不是在C ++ [英] Arduino: Can import library in ino, but not in C++

查看:639
本文介绍了Arduino的:可以在鲍导入库,但不是在C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Arduino的使用UTFT库。如果我有一个 .ino 文件工作,包括有图书馆,一切工作正常,像这样的:

I'm trying to use a UTFT library in Arduino. If I work with a single .ino file and include the library there, everything works fine, like this:

#include <UTFT.h>
UTFT myGLCD(QD220A,A2,A1,A5,A4,A3); 
...

不过,如果我创建一个的.cpp .H 文件,像这样的:

#include <UTFT.h>

example.cpp

#include "example.h"
UTFT myGLCD(QD220A,A2,A1,A5,A4,A3); 
...

我得到一个错误:UTFT并不意味着一个类型

I get an error: UTFT does not mean a type

如果我整个TFT库复制到项目目录,并在使用的#includeUTFT.h example.h文件相反,错误被驳回。

If I copy the whole TFT library to the project directory, and use #include "UTFT.h" in the example.h instead, the error is dismissed.

为什么会出现这种情况,我该如何解决这个问题?

Why does this happen and how can I fix it?

推荐答案

这是一些Arduino的IDE的的魔术

That's some of the magic of the Arduino IDE.

您使用 1.0.6 或公测 1.5.X

在谷歌组正在讨论这些类型的问题,应固定在不久的将来。

Those kind of issues are being discussed on the google group and should be fixed in a near future.

在此期间,你可以给一个尝试到裸Arduino的项目

In the meantime, you can give a try to the Bare Arduino Project.

我们的想法是从IDE,离开组织项目如你所愿,用你喜欢的文本编辑器如VIM或sublimetext与code完成和错误检查。

The idea is to move away from the IDE, organise your project as you wish and use your favorite text editor such as vim or sublimetext with code completion and error checking.

如果您在使用它的任何问题,请随时填写在Github上的问题;)

If you have any issue using it, feel free to fill out an issue on Github ;)

这篇关于Arduino的:可以在鲍导入库,但不是在C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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