Nitrogen-containing heterocyclic carboxamide derivatives represented by the following general formula: <;CHEM>; wherein ring A is a substituted or unsubstituted pyrazine, pyrimidine, pyridazine or triazine ring; R<;1>; is O or OH; R<;2>; is a hydrogen atom, an acyl group or a substituted or unsubstituted carbamoylalkyl or carboxyalkyl group; and the broken line represents a single bond or a double bond; or salts thereof are useful for preventing and treating virus infections and especially influenza virus infections.