my check engine light comes on on 2006 Chevrolet Cobalt

My check engine light comes on after the gas cap indicator comes on, and stays on. don't have the money to get it fixed , should this be something that their are able to fix for free.I have taken it to the service dept several times

Asked by for the 2006 Chevrolet Cobalt
I don't know if anyone wants to work for free but if you're leaving the cap off, it seems the basic problem is simple enough. You may be able to get the code cleared at an auto parts store like AutoZone for free. You may need a new gascap too, buy it from the store that diagnoses your car for free.