Investors & landlords

My stock capital gains are shown on my W-2.   I get a 1099-B form that also shows my gains. So, that's double taxes if I report both in TurboTax.  How to resolve?