Hello, i am having an issue with arduino trying to compile every c++ file in a library i made, one of them is meant for testing on my computer and is just example code really which annoyingly causes a crash as its for my linux machine.
Any ideas how to stop it trying to include this file?
Anything in the library directory or under a "src" sub directory will be compiled.
If you don't want certain files compiled, you must move them somewhere else like to another sub directory under directory for the library. i.e. "extras" etc...
--- bill
bperrybap told you all you need to know, but just in case you want details, they are in the Arduino library specification here:
https://arduino.github.io/arduino-cli/latest/library-specification/#layout-of-folders-and-files
Wait.. There is some sort of library setting that tells the compiler to be more careful about that. And, of course, I forget what it was.. (Ran in to same issue some time ago.)
EDIT : I think this is what you want. You need a library.properties file in your library and at the end put
dot_a_linkage=true
Here is an example of mine. You will need to update the rest of the nonsense to be yours. You may be able to just put on that one line. I donno'. Most of the stuff is for linking it to the IDE as a library you can install.
name=LC_quickCom
version=1.0
author=jim lee
maintainer=quickCom@leftcoast.biz
sentence=A library for master/slave, serial communication.
paragraph=A pair of objects that comunicate with each other over a serial link. One object is designated master, while the other is designated slave. This keeps the communication in synk. (Master /slave, only master can initiate communication.) Communication consists of passing raw data buffers of up to 255 bytes back and forth.
category=Communication
url=https://github.com/leftCoast/LC_quickCom
architectures=*
depends=LC_baseTools
dot_a_linkage=true
-jim lee
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.