保持所有图书馆Arduino的素描目录 [英] Keeping all libraries in the Arduino sketch directory

查看:166
本文介绍了保持所有图书馆Arduino的素描目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,你应该放置在Arduino的安装目录中的库文件夹中的任何外部库,但我有一个使用,我已经为项目创建和几个库一期工程主要是为了保持所有code自我控制,出主PDE文件。不过,我曾试图把库在同一目录作为主要的PDE文件,这样我可以更容易地把一切都在颠覆(我在这方面努力多台计算机上)同步了,我不想一直走下去背部和单独同步了库。此外,只是为了能够着想,容易压缩草图文件夹,并知道它包含它需要的一切。

I know that you are supposed to place any external libraries under the "libraries" folder of the arduino install directory, but I have a project that uses several libraries that I have created for the project and mainly to keep all that code self contained and out of the main pde file. However, I have tried to place the libraries in the same directory as the main PDE file so that I can more easily keep everything synced up in subversion (I work on this on multiple computers) and I don't want to have to keep going back and syncing up the libraries separately. Also, just for the sake of being able to easily zip of the sketch folder and know that it contains everything it needs.

我已经尝试添加的头文件草图作为一个新的标签,但似乎并没有在所有的工作......如果他们起来Arduino的IDE甚至不关心。

I've tried adding the header files to the sketch as a new tab, but that doesn't seem to work at all... don't even care if they should up in the arduino IDE.

我也尝试添加库在子目录草图目录(我将大大preFER),然后链接到他们是:

I've also tried adding the libraries to the sketch directory in subdirectories (what I would greatly prefer) and then linking to them as:

#include "mylib/mylib.h"

#include <mylib/mylib.h>

不过,这两种结果的文件没有发现错误。

But both of these result in file not found errors.

这可能吗?而且,如果是这样,我怎么包括他们在建设的主要文件? preferably在自己的子目录。

Is this possible? And, if so, how do I include them in the main file for building? Preferably in their own subdirectories.

推荐答案

有关我的草图,在* H *的.cpp库文件实际上驻留在同一文件夹中的草图,我叫他们像someheader.h。我也注意到,如果我进入小品菜单和添加文件... 该文件没有出现,直到我关闭并重新打开草图。

For the sketches I have, the "*.h" and "*.cpp" library files actually reside in the same folder as the sketch, and I call them like "someheader.h". I also noticed that if I go into sketch menu and add file... that the file doesn't appear until I close and reopen the sketch.

这篇关于保持所有图书馆Arduino的素描目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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