unresolved externals - function already defined in file ... .obj

Pages: 12
Here I have defined errors: #define ...

Those are preprocessor macros.

This is a "constant":
const char * ERR_regex = ": bracket not found in regex: {y:number} or {x:number}";
how to refer to the ERR_regex or ERR_regex_2 constant


As keskiverto pointed out, what you have are preprocessor macros. The preprocessor will replace any occurance of ERR_regex with the specified quoted string. keskiverto's example of representing constant string is preferred over using defines.

To answer your question though, the compiler will treat those quoted strings (either your define, or keskiverto's example) as const char *. Therefore, your function needs to accept a const char * argument.

1
2
3
4
void error (const char * msg, int eno)  // changed eno from pointer to int value
{   cout << "error" << msg;
    exit(eno);
}


Topic archived. No new replies allowed.
Pages: 12