Q:

Help: convert Arduino code to avr-gcc code

I need to convert Arduino code to avr-gcc code. This is code:
#include <Servo.h> 

Servo myservo; 

void setup() {
  myservo.attach(11);
}

void loop() { 
  myservo.write(67);
}

I use Arduino Mega.

A:

Try this:
#include <Servo.h>

extern "C" void init(void);

Servo myservo;

int main()
{
    init();
    myservo.attach(11);
    for (;;) {
        myservo.write(67);
    }
}

Note that this still needs the Arduino core library, as the Servo
library depends on it, which means all this is an exercise in futility.
If you are using the Arduino core, the simplest thing is to use it the
Arduino way. If you do not want to use Arduino core, then you will have
to partially re-implement the Servo library.

