The invention provides a method of treating drug and alcohol abuse, depression, anxiety, or a compulsive disorder in a subject comprising administering to the subject a compound having the formula:or a pharmaceutically acceptable salt or solvate thereof, wherein R, R1, R2, R3, R4, R5, and X are as defined in the specification.