Closed MrSurly closed 6 years ago
Hi @MrSurly! Actually, appending the library path is not the issue. Here are a few points that prevent this library from compiling correctly:
SX1276Lib
library has the next path in its structure debug/debug.h
. Unfortunately, this path is also used in one of the internal files from the GCC compiler (stl_iterator_base_funcs.h:65
to be precise) and thus build system decided to pick this file instead of a default one.library.json
So, I'd recommend the next workaround:
debug/debug.h
to debug/_debug.h
in the library folder.library.json
file
{
....
"repository": {
"type": "hg",
"url": "https://os.mbed.com/teams/Semtech/code/SX1276Lib/"
},
"build": {
"flags": "-Iradio -Ienums -Iregisters -Iregisters -Isx1276 -Itypedefs"
}
}
Hello @valeros.
Actually, appending the library path is not the issue.
I'd argue that there's no valid use case for appending library include paths to framework builds. Frameworks are never (or shouldn't be) dependent on libraries, thus these paths should never be added when building framework files.
I do understand that the library itself has issues.
So, I'd recommend the next workaround:
One of the major advantages of using PlatformIO in the first place is that it allows workspaces to be easily shared. Libraries installed via lib_deps
in platformio.ini
shouldn't need after-the-fact workarounds. especially considering .piolibdeps
is hidden, and in .gitignore
.
I realize libraries are (for the most part) published by 3rd parties -- is there no vetting process? This particular library is clearly not at all compatible with PlatformIO, since it only supports 1 framework, and won't compile on that framework at all.
I'd argue that there's no valid use case for appending library include paths to framework builds.
This is a bug, we will fix it in PIO Core soon.
This particular library is clearly not at all compatible with PlatformIO
We will improve support for old-style mbed libraries.
I'll inform you here about further updates.
We will improve support for old-style mbed libraries.
Can I help, or is this something the lib maintainer has to do?
Can I help, or is this something the lib maintainer has to do?
Thanks! I opened 2 issues. You are added to CC.
OK, we fix that issue partially on our side. Another part of the issue will be fixed soon. Nevertheless, you don't need to wait for the last fix.
pio upgrade --dev
platformio.ini
[env:disco_l072cz_lrwan1]
platform = ststm32
board = disco_l072cz_lrwan1
framework = mbed
lib_deps = https://os.mbed.com/teams/Semtech/code/SX1276Lib/
Configuration
Operating system: Ubuntu 18.04
PlatformIO Version (
platformio --version
): PlatformIO, version 3.5.2Description of problem
Adding the
SX1276Lib
(2757) causes a compile error in the MBED framework.Steps to Reproduce
pio init --board disco_l072cz_lrwan1
echo >>platformio.ini 'lib_deps=2757'
echo >src/main.cpp 'int main() {}'
pio run
Actual Results
Expected Results
Error-free compilation.
If problems with PlatformIO Build System:
The content of
platformio.ini
:Source file to reproduce issue:
Additional info
Also posted this issue here.
Problem seems to be that PIO will append library include directories when compiling framework source code, which doesn't seem useful -- the framework shouldn't rely on library includes.
Abbreviated command line:
Specifically, this:
-I.piolibdeps/SX1276Lib_ID2757
Full command line: