This is necessary not only for building your leg strength, but also for building endurance in your butt, back, neck, triceps, etc.
It's not only building your body, but also training your body. The way you sit, pedal, and ride has a huge influence on how much discomfort you experience in various parts of your body -- much larger, in fact, than the type of clothing or saddle you use. You can read advice about keeping your back straight, using your core to keep weight off your hands, moving around, etc. But the only way to actually learn these skills is to ride, and build your distance slowly.