How to solve my need for conflicting libraries ?

I work on two separate projects.
project "one",uses libraries\mavlink , and includes GCS_MAVLink.h (from that folder)
project "two" uses libraries\GCS_MAVLink , and includes GCS_MAVLink.h (from the folder)
Problem:

once I add the library "GCS_MAVLink" (needed for project "two") - project "one" get all sorts of errors.
What should I do ? - would renaming libraries\mavlink\GCS_MAVLink.h to mavlink.h work ?

It doesn't seem a great idea to me to have multiple libraries with the same file names inside them. They get copied to a temporary location for compiling.

Renaming the conflicting file should work. You will need to check all other files in that library and change the file name wherever it is used in the library (and in your sketch).

What a mess! Yes change the name of one of them

Chances are that you'll also have a file GCS_MAVLink.cpp. This will have a #include GCS_MAVLink.h at the top. So remember to change this to point to the renamed .h file too.

Thank you, next question is:
Since both libraries are for MavLink, there are more files deeper down the library-subfolders with same names.
Will renaming the main filefix it, or will other conflicts spawn ?
In other words:

When Arduino is compiling, does it only seek files relatively to the library folder containing "GCS_MAVLink.cpp" - or does it just scan all the files in "libraries" every time ?

If you have a directory structure of

DIRECTORY1/DIRECTORY1.h

When you include directory1.h, you are automatically including all the stuff within that directory. So as long as you never use both libraries within the same sketch, you should be ok.

KenF : thank you - confirmed - it works as you said it would , and my problems are solved :slight_smile: