.hpp file ending mandatory? #1760
-
Hi all, I ran into much trouble trying to compile a codebase that I already had to compile on STM32duino (using sloeber - but that is not part of the problem) some weeks (or was it already months?) ago. [rant] As to now I am quite sure that all it takes really is to rename the file to .hpp This is quite strange, since I am almost 100% sure I changed nothing to my setup in the time between "codebase compiles" and "codebase annoys compiler and loads of errors are thrown" |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 2 replies
-
Hi @MasteringTheMess Maybe you do not used this core but this one ? https://github.com/rogerclarkmelbourne/Arduino_STM32 |
Beta Was this translation helpful? Give feedback.
-
Hello @fpistm, sorry for not being precise, time.h is part of my own codebase. |
Beta Was this translation helpful? Give feedback.
-
OK so what did you expect? |
Beta Was this translation helpful? Give feedback.
-
What I expect? well, in the past my Time.h got included correctly, now the compiler complains about the "class" keyword. |
Beta Was this translation helpful? Give feedback.
-
You should go to the forum for this kind of issue and I answered you. Using same name than standard include is not good practice which leads to strange issue. Why it works before I can't tell moreover without any code. About subject: .hpp ending mandatory. Answer is no. 😉 |
Beta Was this translation helpful? Give feedback.
-
Thank you for the advice to go to the forum! I thought this was an issue of the stm32duino, that's why I first came here. I remember changing my time.h from struct to class because the compiler complained about something the AVR compiler gracefully ignored... |
Beta Was this translation helpful? Give feedback.
-
I just keep thinking about this... Is there a way of finding out what filenames are "taken"? |
Beta Was this translation helpful? Give feedback.
-
My guess is that time.h from the standard C library is simply not included but your one is used instead but when standard time.h is required it is probably to build c file with gcc. But as your time.h used class keyword it's failed. I don't understand why you simply not change the name of your file like this include will be done properly... This would be the same if you create stdio.h, math.h, string.h,... |
Beta Was this translation helpful? Give feedback.
-
Of course I did this, my question is to be able to avoid such a problem in the future... |
Beta Was this translation helpful? Give feedback.
-
maybe move this whole topic to a discussion? |
Beta Was this translation helpful? Give feedback.
-
So I am supposed to know all these names? and thanks for the hint that Windows does not care about case - I tend to forget... |
Beta Was this translation helpful? Give feedback.
-
nice one! but if I am correct, then for some reason on several occasions it passed through without error or warning. |
Beta Was this translation helpful? Give feedback.
You should go to the forum for this kind of issue and I answered you. Using same name than standard include is not good practice which leads to strange issue. Why it works before I can't tell moreover without any code. About subject: .hpp ending mandatory. Answer is no. 😉