Hi Nick,
>I'm looking for the reason why global objects defined in statically-linked libraries are not initialized at run time.
Your global object named x is not used in main.cpp, so it is not being included (sort of like the opposite "dead code stripping" -- "live code inclusion"). And hence, is not being constructed.
To force all the symbols (and their corresponding objects) to be incorporated into your main.out from your archive regardless of use, change your compilation like this:
g++ -g -I. main.cpp -L. -Wl,--whole-archive -lTest -Wl,--no-whole-archive -o main.out
HTH, --Eljay