Duplicate Symbol Error from C functions in Objective-C Duplicate Symbol Error from C functions in Objective-C objective-c objective-c

Duplicate Symbol Error from C functions in Objective-C


You should put declarations in the .h file, make them extern, and move definitions into a .c or .m file.

From this

myfunctions.h

int max(int a, int b) {    return a>b ? a : b;}

Move to this:

myfunctions.h

extern int max(int a, int b); // declaration

myfunctions.c

int max(int a, int b) {    return a>b ? a : b;}