I have no idea whether I CAN include contributed libraries in main.cpp
install in Boards Manager some version of AVR boards package, for example 1.6.21 and repeat the experiment
I tried with 1.8.4 and the order of compilation is still the same, contributed libs before core files. Did you want me to see something else? BTW, I am only using 1.6.5-r5 because that's the last(ish) version without the pluggableUSB complication in USB implementation and I could make sense of what they do with USB. With pluggableUSB, there are too many things to make sense.
I meant IDE version 1.8.4. I know what board managers do but not sure how. I'm compiling arduino micro.
Good to know they still use magic numbers. Bookmarked. How do I include contributed libraries in core code again? I still have no idea.
Say Juraj, I want to add some code to main.cpp, implement some new USB device classes in USBCore.cpp etc. that is what I mean by core code. And in these programs, I want to include libraries such as an adafruit 3-axis accelerometer library that is under my arduino sketchbook/libraries/adafruit-stuff folder, how do you go about including it in main.cpp or USBCore.cpp? Thanks.
I need a way to include those libraries and you keep saying that I shouldn't. I'm not sure how far I have to lead you down my rabbit hole to convince you that I should. I will give it a try. The code that attaches USB is in main.cpp. I need some prep work before USB attach so my code goes in main.cpp