I have a fairly complex C++ code that generates a segmentation fault as soon as it loads. The first statement in main() never gets executed. I think the problem lies in a static library libWhatever.a because the segmentation fault only occurs if I try to instantiate an object from that library. How would a smart person debug this problem?
EDIT #1: The code that instantiates the object never executes. In fact I put it inside an if-statement with a clause that I know is impossible (but the compiler does not know). That is why I think the code is seg-faulting at load-time.