Comments (13)
Same problem for me: library not found.
I tried two cases:
1• the library is in the sketchbook/libraries user folder,
2• the library is in the project's src sub-folder.
Both return an error.
from ino.
It seems that ino fails when parsing the dependencies.d
file, when multiple dependencies are given in a single line:
sketch.o: .build/src/sketch.cpp \
/Applications/Arduino.app/.../arduino/Arduino.h \
/Applications/Arduino.app/.../arduino/binary.h \
...
/Applications/Arduino.app/.../arduino/new.h \
/Applications/Arduino.app/.../standard/pins_arduino.h \
lib/SSegs/SSegs.h lib/Framebuffer/Framebuffer.h lib/Metro/Metro.h
The problem is that match only matches the first occurence. Without changing the REs, the fix is as simple as this:
in commands/build.py
:173
used_libs = set()
with open(output_filepath) as f:
for line in f:
matches = local_re.findall(line) or dist_re.findall(line)
for match in matches:
used_libs.add(match[0])
While using findall is not as nice as the regular match (as we lose references to named groups), it works. I'll provide a patch later.
from ino.
Did anyone get includes to work correctly? The pull request doesn't work for me.
from ino.
Here is a link to a test sketch that builds: test-sketch.zip
This is the sketch file tree:
test-sketch/
lib/
TestLib/
TestLib.h
TestLib.cpp
src/
sketch.ino
TestLib is simply imported as #include <TestLib.h>
, as it will automatically be in the path.
from ino.
Okay, that works fine. But what about something like this:
test-sketch/
lib/
src/
sketch.ino
defines.h
There's no way to include defines.h in sketch.ino but this build fine using the official IDE. If you can help me to get it working, it'd be awesome.
from ino.
I'm sorry, I misunderstood your problem, I thought it was the same as mine.
Well, I know the official Arduino IDE concatenates all the tabs open in the project. Perhaps ino only concatenates multiple .ino files? I'll make some tests.
Regarding #including per se: it seems that the automagic build step moves sources around. If so, then a #define "lib.h"
would search for the file in the wrong directory. I remember having witnessed this during my initial troubles with imports.
from ino.
I'm referring to the user-developped libraries, placed in the sketchbook/libraries folder.
The sketchbook directory is declared in the Preferences pane of the Arduino IDE.
The sub-folder called Libraries
is included in the building process by default.
from ino.
@rei-vilo: You need to move the user-developed libraries to the lib
subfolder.
@zenojevski: gcc searches for the headers in the current directory
, but I don't understand the MakeFile.jinja code well enough to make it work correctly. Somewhere the header files need to be moved to the working directory of gcc...
from ino.
If you write #include "../../src/Defines.h"
it works without problems. That means the .h
files only need to be moved in the .build/src/
directory like the other files.
I don't know where ino does the copying of the files, but I will try to solve the issue now.
from ino.
There is now a working fork with simple includes: #20
from ino.
@fabiankr Here is a less invasive "fix" that allows importing from "src/" by adding it to the dependency scan. I've also added a few fixes and a test sketch a couple commits later.
If you could let me know if it works for your situation it'd be great.
from ino.
It works like a charm. I like your solution more, thanks. :)
from ino.
@fabiankr Thanks!
from ino.
Related Issues (20)
- leonardo not available in the list-models
- leonardo not available in the list-models HOT 1
- Permission denied when I run ino init HOT 1
- Please explicitly disallow python-3 installs until you support it. HOT 1
- What about Arduino 1.6.7 support? HOT 3
- ino build command fails on rasberry pi HOT 1
- Why not distribute boards.txt as fallback with ino package? HOT 1
- please expand quick start to summarize initial installation HOT 10
- Arduino Leonardo clone (Pro Micro) fails to reset and upload from Raspberry Pi HOT 2
- i2ckeypad error!!!!!!!! HOT 1
- Upload code to esp8266 nodemcu using raspberry pi
- Running on windows 10 HOT 2
- lib directory HOT 3
- mis-type, please delete. My apologies.
- Issue running 'ino --help' after fresh install (pip install ino) HOT 1
- Cannot find board descriptions in arduino-1.8.5 environment HOT 3
- ino upload error
- Support for other microcontrollers
- unable to close serial port
- ‘constexpr’ only available with -std=c++11 or -std=gnu++11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ino.