We describe a general method for modeling gamma-ray burst prompt emission , and determine the range of magnetic field strength , electron energy , Lorentz factor of the source , and the distance of the source from the central explosion that is needed to account for the prompt \gamma -ray emission of a typical long duration burst . We find that for the burst to be produced via the synchrotron process unphysical conditions are required – the distance of the source from the center of the explosion ( R _ { \gamma } ) must be larger than \sim 10 ^ { 17 } cm and the source Lorentz factor \lower 2.0 pt \hbox { $ \buildrel { \scriptstyle > } \over { \scriptstyle \sim } $ } 10 ^ { 3 } ; for such a high Lorentz factor the deceleration radius ( R _ { d } ) is less than R _ { \gamma } even if the number density of particles in the surrounding medium is as small as \sim 0.1 cm ^ { -3 } . The result , R _ { \gamma } > R _ { d } , is in contradiction with the early x-ray and optical afterglow data that show that \gamma -rays precede the afterglow flux that is produced by a decelerating forward shock . This problem for the synchrotron process applies to all long-GRBs other than those that have the low energy spectrum precisely \nu ^ { -1 / 2 } . In order for the synchrotron process to be a viable mechanism for long-bursts , the energy of electrons radiating in the \gamma -ray band needs to be continuously replenished by some acceleration mechanism during much of the observed spike in GRB lightcurve – this is not possible if GRB prompt radiation is produced in shocks ( at least the kind that has been usually considered for GRBs ) where particles are accelerated at the shock front and not as they travel down-stream and emit \gamma -rays , but might work in some different scenarios such as magnetic outflows . The synchrotron-self-Compton ( SSC ) process fares much better . There is a large solution space for a typical GRB prompt emission to be produced via the SSC process . The prompt optical emission accompanying the burst is found to be very bright ( \buildrel { \scriptstyle < } \over { \scriptstyle \sim } 14 mag ; for z \sim 2 ) in the SSC model , which exceeds the observed flux ( or upper limit ) for most GRBs . The prompt optical is predicted to be even brighter for the sub-class of bursts that have the spectrum f _ { \nu } \propto \nu ^ { \alpha } with \alpha \sim 1 below the peak of \nu f _ { \nu } . Surprisingly , there are no SSC solutions for bursts that have \alpha \sim 1 / 3 ; these bursts might require continuous or repeated acceleration of electrons or some physics beyond the simplified , although generic , SSC model considered in this work . Continuous acceleration of electrons can also significantly reduce the optical flux that would otherwise accompany \gamma -rays in the SSC model .