From reply #1:
"Basically the Arduino uses a combination of C and C++ as its code basis but the Arduino IDE does a lot of the background work for you, including generating the main() function which is required by every C program."
So, where is main() in your Atmel Studio version of the program?
"If you poke around enough in your Arduino folders you should be able to find the actual C program created by the Arduini IDE and compare that to your sketch to see some of what has happened."
Have you done this?
Don