According to wikipedia, the delta-v neccessary to reach low earth orbit is 9.4 km/s. This is roughly 30 times the speed of sound. Launched from a cannon, a payload would need enough initial velocity to have that speed at the top of the atmosphere, after encountering several km of athmospheric drag. I did not work out the math of what that means for initial velocity, but it will be tremendous. While there are laboratory guns that fire very fast projectiles - up to 16 km/s - those fire only little specks of dust. Scaling up the technology will be hard.
To take a look at the numbers and g-forces, at 1000 g constant acceleration we would need 1 seconds to reach 9.8 km/s, and a barrel of 500 m length (!). The speed was picked to arrive at round numbers.
A projectile from a cannon has it's highest speed right at launch, where the athmosphere is thickest and thus the drag the highest, but would not need to lift the mass of the fuel. I think it's hard, but doable, to calculate which technology may be more energy efficient for a given payload.
To sum it up, the speeds needed are beyond what is achievable with common cannons and the like, we need different approaches that may be doable but have not been implemented near the scale of what is needed to shoot a payload into space.