static ObjectClassSchemaCheckFN aliasObjectClass;
 static ObjectClassSchemaCheckFN referralObjectClass;
 static ObjectClassSchemaCheckFN subentryObjectClass;
+#ifdef LDAP_DYNAMIC_OBJECTS
 static ObjectClassSchemaCheckFN dynamicObjectClass;
+#endif
 
 static struct slap_schema_oc_map {
        char *ssom_name;
 static AttributeTypeSchemaCheckFN referralAttribute;
 static AttributeTypeSchemaCheckFN subentryAttribute;
 static AttributeTypeSchemaCheckFN administrativeRoleAttribute;
+#ifdef LDAP_DYNAMIC_OBJECTS
 static AttributeTypeSchemaCheckFN dynamicAttribute;
+#endif
 
 static struct slap_schema_ad_map {
        char *ssam_name;
        return LDAP_SUCCESS;
 }
 
+#ifdef LDAP_DYNAMIC_OBJECTS
 static int dynamicObjectClass (
        Backend *be,
        Entry *e,
 
        return LDAP_SUCCESS;
 }
+#endif /* LDAP_DYNAMIC_OBJECTS */
 
 static int rootDseAttribute (
        Backend *be,
        return LDAP_OBJECT_CLASS_VIOLATION;
 }
 
+#ifdef LDAP_DYNAMIC_OBJECTS
 static int dynamicAttribute (
        Backend *be,
        Entry *e,
 
        return LDAP_SUCCESS;
 }
+#endif /* LDAP_DYNAMIC_OBJECTS */