Probably made the mistake of #including windows.h...
One of the tricks I use for non-template external libraries / functions that have 'expensive' includes, is to wrap them in your own .h / .cpp file. So you only include your own .h to use the functions rather than the third party. Yours can be clean and fast compiling, even if the external is rubbish.
E.g.
//my_windows_wrapper.h
#pragma once
#ifndef QUICK_BUILD
#include <windows.h>
#endif
class WinWrapper
{
public:
#ifdef QUICK_BUILD
void some_windows_func();
#else
// will get optimized out
void some_windows_func()
{
// call windows
some_dodgy_windows_func()
}
#endif
};
//my_windows_wrapper.cpp
#include "my_windows_wrapper.h"
#ifdef QUICK_BUILD
#include <windows.h>
void WinWrapper::some_windows_func()
{
// call windows
some_dodgy_windows_func()
}
#endif
Then for final release you can change the QUICK_BUILD define and it will link directly to the third party code. There might be an even better way of doing this.
Optimizing compile / link times can be really important in big projects to reduce iteration time, and there's no reason why you can't do it at zero cost for final release builds.