Originally Posted by belnac
Turns out one has to use the following syntax
I understand why that eliminated your symptom, but I don't believe it was either necessary or best.
You should try NevemTeve's earlier suggestion: Move the .a file in the linker command line so that it appears after
all the .o files.
Linker documentation won't tell you the simple rule that .a files must be later in the command line than .o files, because the linker does not consider that to be an absolute rule. I'm sure there is some obscure situation in which you would want some .a file before some .o file in a linker command (though at the moment I can't think of it). But the relative sequence often makes a difference and when it does make a difference the results you get by putting the .a after the .o are almost certainly what you want and the results of putting the .a before the .o are likely not what you want (as in this case where a symbol gets resolved at link time if the .a is after the .o, but is left to be resolved at load time if the .a is before the .o).