Aha! Needed config.h for BGD_DECLARE to be defined.