Have you read From the Earth to the Moon?
Are you seeing this as a solution for putting anything useful into orbit? Have you considered the G-forces that are encountered during acceleration in the barrel?
While it's true you need less acceleration to overcome the Earth's gravity starting from high altitude, assuming your gun is stationary relative to some point on Earth, your payload still must be accelerated from 500 meters/sec to orbital velocity of 30,000 meters per second inside it the time it takes to reach the end of your barrel. You may find that nothing organic would survive and neither would most mechanical devices.
The US Dept of Defense tried a gun launcher with Project HARP in the 1960s, but it was then only funded for re-entry experiments. The inventor behind it, Gerald Bull, had the same dream as you, but never succeeded in getting anywhere with it, largely due to the G-Force issues, and while he got funding from Saddam Hussein (who really just wanted a big gun to fire at Iranians), he was assassinated in Belgium in 1990, which has kept the conspiracy theorists going about how "they" wanted to suppress the idea that a gun is the best way to get into space.
It is astonishing to realize that until Galileo performed his experiments on the acceleration of gravity in the early seventeenth century, nobody questioned Aristotle's falling balls. Nobody said, Show Me!