www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Symbol Undefined __exception

↑ ↓ ← "David Grimes" <dgrimes friberg.us> writes:
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
↑ ↓ → Phil Thompson <phil electricvisions.com> writes:
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