Everything currently requires fossil fuel sourced energy to create it. So the question is, over the expected lifespan of the object, will it create more energy than was required to produce it? Solar panels expected lifespan is about 30 years. Installation, transport, etc. are all a fixed initial carbon cost. Studies and analysis have already been done (google search for studies from NREL) and the initial carbon cost payback is about 3-4 years of a typical 30 year solar panel lifespan. So 27 years of effectively carbon negative power generation.
But also consider the downstream effects. Once you have a carbon negative power source like solar in place, the carbon cost to create other things drops as well (since they use less and less power from fossil fuel sourced power).