Skip to content

If 2 libs have same .h file, use the lib with same dir name #1853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2014
Merged

If 2 libs have same .h file, use the lib with same dir name #1853

merged 1 commit into from
Feb 11, 2014

Conversation

PaulStoffregen
Copy link
Contributor

When 2 libraries have a header with the same name, Arduino will use the last one it finds, because the list is built with very simple code that stores the last directory name it finds.

This has caused a lot of headaches for libraries like Adafruit_GFX where a copy is located in Robot_Control. Even with Robot_Control modified to avoid this specific conflict, the opportunity for incorrect matching is still present. ANY library that contains the file "Adafruit_GFX.h" can cause the correct library to not be used by the Arduino IDE.

This patch causes the IDE to always give preference to a library whose name matches the header file.

If 2 libraries have the same header, but neither matches the library name, the IDE will still use the last one it find. This patch only addresses the easy but most important case, where the header and library name match.

cmaglie added a commit that referenced this pull request Feb 11, 2014
If 2 libs have same .h file, use the lib with same dir name
@cmaglie cmaglie merged commit b78fcf5 into arduino:master Feb 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants