How do I prevent my ‘unused’ global variables being compiled out of my static library?

The compiler is not allowed to optimiza away global objects.
Even if they are never used.

Somthing else is happening in your code.
Now if you built a static library with your global object and that global object is not referenced from the executable it will not be pulled into the executable by the linker.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)