Abstract: The present application relates to azaaromatic amide derivatives for the treatment of cancer. Specifically, the present application relates to a preparation method and use of azaaromatic amide derivatives. The present application relates to azaaromatic amide derivatives and anilino-pyrimidine compounds represented by formula (I), formula (II), formula (III), formula (IV), and formula (V), and pharmaceutically acceptable salts thereof; the compounds or salts thereof can be used to treat or prevent a disease or disorder by regulating certain mutant forms of epidermal growth factor receptors. The present application also relates to a pharmaceutical composition comprising the compounds or salts thereof, and a method for treating various diseases mediated by EGFR, or HER2, or HER4 by using the compounds and salts thereof.