A New York City building collapsed Wednesday, and people were trapped in the rubble, the fire department said.