Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Arduino C++ IDE ignoring .c source files for headers at build
Arduino C++ IDE ignoring .c source files for headers at build [message #1809671] Fri, 19 July 2019 16:16 Go to next message
Alan Jurisich  is currently offline Alan Jurisich Friend
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

Re: Arduino C++ IDE ignoring .c source files for headers at build [message #1809716 is a reply to message #1809671] Mon, 22 July 2019 00:15 Go to previous message
Helen Keller is currently offline Helen KellerFriend
Messages: 173
Registered: June 2019
Senior Member
You will probably get an answer "not a Eclipse fault" but complier / linker "options" ( are set wrong).
Then the answer will be in Eclipse project "Properties".

I have always ignored nuances of comping / make and my guess is that is where the "problem" is.
Perhaps one of mine another favourite - mixing C and C++ is another way to look at this.
Previous Topic:Arduino Due Native USB Port
Next Topic:g++ warning: ignoring old commands for target 'xxx.o'
Goto Forum:
  


Current Time: Fri Apr 26 19:43:38 GMT 2024

Powered by FUDForum. Page generated in 0.02834 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top