我的情况如下:
\ lstset {%language = c ++,basicstyle = \ footnotesize,数字=左,numberstyle = \ tiny \ color {gray},stepnumber = 2,keepspaces = true,numbersep = 5pt,backgroundcolor = \ …
可能是因为你在rulecolor线后丢失了一个逗号?