Multiple definition error on variable that is declared and defined in header file and used only in its cpp file
问题 I'm in the process of moving code written to be compiled for one chip onto another chip. One issue that's come up is a multitude of multiple definition errors. Some of which appear to be due to the linker for the first chip letting me be lazy with declaring variables extern when they are to be used across multiple source files. I didn't use extern at all previously (declare and define a variable in something.h, use it in something.cpp and other source files that included something.h) and it