c++ - Symbol Undefined __exception
- David Grimes (23/23) Feb 16 2004 main.c:
- Phil Thompson (7/38) Feb 17 2004 If you look in math.h exception is defined as a struct unless you do:
main.c: #include <math.h> #include "a.h" int main(void){ exception("math.h"); return 0; } a.h: void exception(char *string); a.c: #include <stdio.h> void exception(char *string) { printf("Exception: %s\n", string); } ---------------------------------------- dmc main.c a.c main.obj(main) Error 42: Symbol Undefined __exception If math.h is included in main.c the compiler reports the above error. According to the latest C standard "exception" is not reserved word nor part of the standard math library. David
Feb 16 2004
If you look in math.h exception is defined as a struct unless you do: #define _EXCEPTION_DEFINED Including this define in your code fixes the problem but I'd probably choose a different name for your function. Regards, Phil David Grimes wrote:main.c: #include <math.h> #include "a.h" int main(void){ exception("math.h"); return 0; } a.h: void exception(char *string); a.c: #include <stdio.h> void exception(char *string) { printf("Exception: %s\n", string); } ---------------------------------------- dmc main.c a.c main.obj(main) Error 42: Symbol Undefined __exception If math.h is included in main.c the compiler reports the above error. According to the latest C standard "exception" is not reserved word nor part of the standard math library. David
Feb 17 2004