Microcracks and inhomogeneously distributed defects in solids