I'm looking for the reason why global objects defined in statically-linked libraries are not initialized at run time. Example: ------------------------------------------------------------------------------- bash@puma$ cat lib.cpp #include <iostream> class X { public: X() { std::cout << "Inside X constructor\n"; } }; // instantiate global object X x; bash@puma$ cat make_static g++ -g -c -o lib.o lib.cpp ar -r libTest.a lib.o stecklen(bash)@puma[link_test]$ ./make_static stecklen(bash)@puma[link_test]$ cat main.cpp #include <iostream> int main() { std::cout << "Inside main.\n"; return 0; } bash@puma$ cat make_bin g++ -g -I. main.cpp -L. -lTest -o main.out bash@puma$ ./make_bin bash@puma$ ./main.out Inside main. bash@puma$ ------------------------------------------------------------------------------- If I change the line that makes the lib to "g++ -shared -o libTest.so lib.o" and recompile main, the object is initialized. Why is this? Thanks for any information.