In my opinion, it is best to use a first-principles approach when solving compressible flow problems.
Personally, I first decide whether the situation corresponds more closely to isothermal flow versus adiabatic flow. Then, I use the first-principles formulas for both these extremes. The final answer is likely somewhere in between, unless you are heating or cooling the pipe significantly. For compressible flow with heat transfer, e.g., in a furnace, you have to break up the pipe into segments and use computers as the iteration is simply too much to do by hand.
Even for "simple" isothermal and adiabatic flow, the calculations require trial and error, unfortunately. This is fairly erasily handled by the "solver" in Excel, however. See Streeter and Wylie, pages 284-289 (adiabatic) and pages 294-296 (isothermal) in "Fluid Mechanics", (1st SI Edition, McGraw-Hill, 1983).
Another beautiful summary of the basic methods for both adiabatic and isothermal flow in conduits is shown on pages 133-139 of McCabe, Smith, and Harriott "Unit Operations of Chemical Engineering" (5th ed., McGraw-Hill, 1993).
A much higher level of complexity arises in case the gas is far from ideal conditions (at a high pressure and low temperature, when the compressibility factor is far from unity). In that case, you will need to divide the pipe into many segments (I use at least ten) and do the calculation by trial and error. Also, you will have to call a thermodynamic routine to find the average compressibility factor of the gas at flowing conditions at each segment of the pipe to get the density required for velocity calculations.
The most important item, as pointed out by Montemayor, is that flow rate requires pressure drop so you need to be clear about which problem you are solving. You can specify three of the following four variables and solve the equations for the fourth: length, diameter, flow, pressure drop. Of course, the inlet stream pressure and temperature of the gas must be known.