In 7th Edition UNIX™, there were two functions index() and rindex() that are respectively equivalent to the standard C functions strchr() and strrchr(), give or take const (which didn't exist when those functions were defined, any more than prototypes existed; there wasn't even C with Classes back then).
You're running foul of the backwards-compatible declarations of the function rindex(). The names index() and rindex() are archaic, but you can't use them blithely in your own code. Choose a different function name.
In 7th Edition UNIX™, there were two functions index() and rindex() that are respectively equivalent to the standard C functions strchr() and strrchr(), give or take const (which didn't exist when those functions were defined, any more than prototypes existed; there wasn't even C with Classes back then).
You're running foul of the backwards-compatible declarations of the function rindex(). The names index() and rindex() are archaic, but you can't use them blithely in your own code. Choose a different function name.
/* include standard string */
#include <string.h>
/* alias standard rindex to rindex_std */
#define rindex rindex_std
/* include your OS defined strings.h */
#include <strings.h>
This will solve the conflict.