If you say they have a longer life, you have to say "longer THAN'
Furthermore, I think it should be "compared to" (not "compared with"), but I suppose "with" is acceptable.
1. Fluorescent lamps have a long life compared to incandescent lamps.
This is correct.
2. Fluorescent lamps have a longer life than incandescent lamps.
Now this is correct.