Nitrogen-containing heterocyclic carboxamide derivatives represented by the following general formula:wherein ring A is a substituted or unsubstituted pyrazine, pyrimidine, pyridazine or triazine ring; R1 is O or OH; R2 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.