Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How am I supposed to compile/generate a .hex file (object code) of a c program using a gcc compiler?. Will the procedure be the same for a different gcc compiler compatible with a different processor?

share|improve this question
Have you used gcc before on e.g. windows or a mac? – Yet Another User Jun 13 '13 at 15:16

Do you mean this here ? :

gcc -c example.c

objcopy --change-address 0xE0000 -O ihex example.o example.hex

share|improve this answer
Will this command apply to any other gcc compiler?.For eg: I have installed a gcc compiler that is compatible with some xyz processor.Will this same command generate the corresponding object code? – user166921 Jun 13 '13 at 16:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.