gcc (GCC) 4.7.2 c89
Hello,
My service.h file has the following:
enum service_state_code { NO_ERROR_OK, ERROR_INCORRECT_STATE, ERROR_EMPTY_STRING, ERROR_NO_COMMAND_FOUND }; const char *service_state_msg[] = { "OK:", "ERROR: Incorrect state for modifying service channel state", "ERROR: No command found", "ERROR: No command parameters", NULL }; get_channel_service_state(channel_t *channel, const char *msg);
And I have 2 more * .c files that will contain the service.h file.
network.c and socket.c
And I use it something like this:
get_channel_service_state(channel, ss7_service_state_msg[ERROR_INCORRECT_STATE]);
However, I get a linker error complaining about:
multiple definition of service_state_msg first defined here
I know the reason why I get this error. Since service_state_msg defined twice as global in service.h, each time it is included in the * .c file.
I'm just asking, what is the best way to use service_state_msg across multiple * .c source files?
Thanks so much for any suggestions,
source share