Re: multiple declaration error



  does anyone know why i get the following error even
though i've only declared the function once?

callbacks.o(.text+0x0): In function
`draw_button_clicked':
/home/programs/animation4/src/callbacks.c:17: multiple
definition of `draw_button_clicked'
main.o(.text+0x0):/home/programs/animation4/src/callbacks.c:17:
first defined here
collect2: ld returned 1 exit status
make: *** [a] Error 1


2 possible faults:

1) You have a function named draw_button_clicked that is not static
defined two places (c files).

2) You have linked a .o file twice into your target.

for instance

gcc callbacks.c callbacks.o -o main

gcc callbacks.o callbacks.o -o main




Stian Skjelstad aka mw|



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]