February 17, 2004 Symbol Undefined __exception | ||||
---|---|---|---|---|
| ||||
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 |
February 17, 2004 Re: Symbol Undefined __exception | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Grimes | 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 > > |
Copyright © 1999-2021 by the D Language Foundation