tomswartz07 / arduino-makefile

Generic Makefile to build Arduino .ino sketches from the command line
Creative Commons Zero v1.0 Universal
95 stars 18 forks source link

Library with same file name as arduino core filename yields linking error #3

Open Sembiance opened 8 years ago

Sembiance commented 8 years ago

I was trying to use the FastLED library, which happens to have a 'wiring.c' file.

Because your Makefile compiles all source files into the same directory, this overwrites the 'wiring.cpp' output from arduino core, thus leading to a linker error.

I've been using https://github.com/arons/ArduinoDevel/ in the mean time as a workaround.

tomswartz07 commented 8 years ago

I suppose that the library files could be appended with a -lib, so in your case the files would be wiring.ino and wiring-lib.c

Would this be acceptable?

Sembiance commented 8 years ago

That would fix it my particular issue, but if you had different libraries that had the same source filename, that wouldn't work for them. So it would only be a partial fix for the more general problem.

It's not that big a deal for me, as the other Arduino makefile project I linked seems to work just fine so I'll probably just continue using that. I just thought I would report the bug just in case.

tomswartz07 commented 8 years ago

I suppose I was misunderstood; I'll clarify.

The makefile will copy over the library files with the appended name, so this will fix the naming issue for any case where the *.ino file name maches the library.

I'll try to get the fix up later today or tomorrow.

Thanks again for reporting it!