The invention relates to an anticancer medicine which is a lanosterol derivative. The compound has an anticancer effect, and can inhibit the growths of lung cancer cells, liver cells, mammary gland cells, brain cancer cells, and pancreatic cancer cells. The medicine is a compound with a general formula of (I), (II), (III), or (IV). The invention also provides an application of the compound or pharmaceutically acceptable salt thereof in preparing medicines used for treating cancers. The medicine can be used independently, and can be used in combination. Especially, the medicine can be used in combination with gemcitabine or nexavar. The medicine can be used in treating cancers such as lung cancer, liver cancer, pancreatic cancer, breast cancer, brain cancer, and the like.