Problem in emulating exceptions in CRT for OS applications
Posted: Sun Aug 23, 2009 11:41 am
I'm trying to use mingw32 g++ to build PE applications for my OS. After doing the initialization for global objects, I have some troubles dealing with the exceptions.
I write a source file test.cpp as below:
Then I compile it:
g++ test.cpp -c -o test.o
ld test.o -o test.exe
But I'm amazing that I could not find any dissamble code about exceptions. I'm wondering whether g++ will disable exceptions if there's no stdlib included in.
By the way, adding the -fexceptions flag is no use.
I write a source file test.cpp as below:
Code: Select all
void main()
{
int i;
try{
i=0;
i=i/i;
}catch(int e){
i=1;
}
}
g++ test.cpp -c -o test.o
ld test.o -o test.exe
But I'm amazing that I could not find any dissamble code about exceptions. I'm wondering whether g++ will disable exceptions if there's no stdlib included in.
By the way, adding the -fexceptions flag is no use.