Multiple instances of singleton across shared libraries on Linux
First, you should generally use -fPIC flag when building shared libraries. Not using it “works” on 32-bit Linux, but would fail on 64-bit one with an error similar to: /usr/bin/ld: /tmp/ccUUrz9c.o: relocation R_X86_64_32 against `.rodata’ can not be used when making a shared object; recompile with -fPIC Second, your program will work as you expect … Read more