The present invention provides a treating agent for cancer having Trk inhibitor resistance. A compound represented by the general formula (I)(in formula, all symbols have same meanings as those described in the specification.) or its salts, its N-oxides, its solvates, or their prodrugs can be used as an effective ingredient of a treating agent for cancer having Trk inhibitor resistance.本發明,在於提供Trk抑制劑抵抗性的癌治療劑。通式(I)(式中,所有的記號,表示與說明書中記載之記號的相同之意。)所示之化合物、其鹽、其N-氧化物、其溶劑合物、或此等之藥物前體,可使用為Trk抑制劑抵抗性的癌治療劑之有效成分。