Arduino C++ IDE ignoring .c source files for headers at build [message #1809671] |
Fri, 19 July 2019 16:16 |
Alan Jurisich Messages: 1 Registered: March 2019 |
Junior Member |
|
|
I recently ran into a problem compiling a tutorial project from Make: AVR Programming called serialLoopback.c (.cpp when created through the plugin). When compiling, the functions called from USART.h and defined in USART.c (like you do...) were claimed to be undefined. The problem is well known with the AVR Freak community and the short and skinny of it is USART.c wasn't being compiled. Everyone on AVR Freaks of course uses Atmel Studio so the fixes there didn't apply to me.
The files were in the right directories with the right pre-processor directives however they still wouldn't compile. I thought to myself "wouldn't it be funny if USART.c was just being ignored because it had the wrong extension for the project...". I changed USART.c to USART.cpp and boom. worked immediately.
So after that bag of wind I was wondering why did eclipse ignore USART.c. What part of the build process was responsible (the linker right)?. Can I tell it NOT to ignore C source files in the future? Is that just not practical or recommended?
My experience is pretty minimal especially when it comes to the intricacies of compiling, IDE nuances, and makefiles. I'd like to build a better foundation in those topics.
Edit: Updated title to better reflect the purpose of the post.
[Updated on: Sat, 20 July 2019 08:21] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02834 seconds