Closed Awbmilne closed 3 years ago
In short, try the chain+
mode:
[env:myenv]
lib_ldf_mode = chain+
If that doesn't work try defining explicitly:
[env:myenv]
lib_ldf_mode = chain+
build_flags = -D __IMXRT1062__
Thanks, @liquiddandruff for the solution!
Really appreciate it @liquiddandruff ! 🥂
Configuration
Operating system: Windows 10
PlatformIO Version: v5.0.4
Description of problem
When building a project with preprocessor directives that optionally include certain libraries, Libraries that are NOT needed/wanted are included when compiling. This creates issues when you have two libraries that define the same symbols with different values.
Steps to Reproduce
This issue reared its head when compiling Networking code for a Teensy 4.1. Compiling the below file set should recreate the issue:
main.cpp
platformio.ini
Actual Results
Expected Results
Additional info
While this is generally not an issue, In specific cases like this one, This creates an issue where the wrong version of
Ethernet.hardwareStatus()
is used (along with the rest of the ethernet functions), meaning the Ethernet connection doesnt work. This is best demonstrated by the Serial output of the above script.Expected
Actual
Solution
In order to eliminate this issue, preprocessor directives need to be taken into account either during the dependency search or during the compiling.