From: Dave H. <dhy...@gm...> - 2007-06-13 16:51:53
|
Hi Daniel, On 6/13/07, fo...@it... <fo...@it...> wrote: > I am trying to compile a program for the robostix with I2C support, and I > am getting the following error: > > +++++++ > [fokumdt@iodine i2c-Sensor]$ make > Creating svn-version.h ... > make: Circular i2c-Sensor.elf <- i2c-Sensor dependency dropped. This warning is significant. It suggests that you somehow have a circular dependency. > In function `__bad_interrupt': > ../../../../crt1/gcrt1.S:123: undefined reference to `main' > make: *** [i2c-Sensor.elf] Error 1 There is a main function in i2c-io.c. If you do "make v=1" it will show the complete command line being used. If you're not linking in i2c-io.c and you're replacing it with i2c-Sensor.c then it will need to proviode a main function which does more or less the same stuff that i2c-io.c does. You can find out whether your file is exporting the main function or not by running: avr-nm i2c-Sensor.o I've done this for i2c-io.o below: >avr-nm i2c-io.o U __do_clear_bss U __do_copy_data 0000003e a __SP_H__ 0000003d a __SP_L__ 0000003f a __SREG__ U __stack 00000000 a __tmp_reg__ 00000090 T __vector_33 00000001 a __zero_reg__ 0000000e D gDDR 00000000 D gPIN 0000001c D gPORT U gTickCount U I2C_SlaveBootHandler U I2C_SlaveBootInit U I2C_SlaveBootProcessCommand U InitHardware 00000000 T main 000000e2 T ProcessCommand The symbols with numbers beside them are actually defined. T = public function t = static function U = undefined (i.e. a reference to an external function or variable). D = public variable d = static variable As you can see main is listed. So, do an avr-nm on i2c-Sensor.o and also do the following: make clean make v=1 and show us the output. If you want to send me the Makefile, I can figure out what the circular reference is about. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |