The present invention relates to a compound having RET kinase inhibiting action or a pharmaceutically acceptable salt thereof, useful in the treatment of diseases such as cancer. In particular a compound represented by the following general formula (I) as defined herein: (I) or a pharmaceutically acceptable salt thereof.