Only see warnings sometimes

I have a project where one of my local libraries gives me a compiler warning. If I build the project with that particular file open and its window selected I see the warning. If I have another window such as main.cpp open and selected I see no warnings and the build is successful. I want to see warnings all the time no matter which window is open when I compile. Thanks