extern and static are incompatible. static means the variable is accessible only in the one compilation unit, which means it can't be used in a separate compilation unit (which is why you would use extern).
However, Arduino is "special" because it concatenates tabs together into a single compilation unit (assuming each file is an .ino file), and so you don't need a declaration in the other tab to use the unitMin variable. You can just use the variable because Arduino will take care of the declaration for you.
If you look in pgmspace.h at all the memcpy_P(), etc. functions, you will see that the pointer pasted in has no special designation, just a const char *
I don't think you need the PROGMEM attribute on your external declaration in you .cpp file. You have to know the string is in PROGMEM and call the appropriate function to read it from there.
C:\Users\dahls\AppData\Local\Temp\ccll7bDA.ltrans1.ltrans.o: In function `loop':
<artificial>:(.text+0x338c): undefined reference to `unitMin'
<artificial>:(.text+0x3390): undefined reference to `unitMin'
collect2.exe: error: ld returned 1 exit status
It work if I copy the line from the .ino file to the .cpp file as-is.
This declares a variable unitMin, that contains a pointer to a const char, but does not specify that unitMin itself is const, preventing it from being stored in PROGMEM
extern const char* const unitMin PROGMEM;
This will eliminate the error message, but you will still have a problem because the original declaration of unitMin is as a char array, not a char*.
This should compile OK, have not actually written any working code to test it.
I think you've nailed the problem. PROGMEM really doesn't do anything for an external declaration. Also static cannot be used in the definition.. So: const char unitMin[] PROGMEM = "min.";
and: extern const char *unitMin;
I tried this and it compiles without errors or warnings.
It's a common, industry-wide practice to put the 'extern' declarations in a .h file ("TimeStrings.h" in my example) and #include that file in any .cpp (or .ino) that needs to access the global variables. Likewise, it's also common practice to #include that .h file in .cpp (or .ino) file where the global variables are actually defined. If you follow that paradigm, then the externs can't be:
That's true, of course, but I was just trying to solve the OPs problem which was to not use PROGMEM on the extern nor define the array as static. Basically combine the fix given in #4 and #7, which it appears he never tried.
And the issue of using header files is confounded by the Arduino IDE merging "iso" files, rearranging them and automatically adding declarations. I don't think Arduino (the organization) really wants people to use header files!