Problem in emulating exceptions in CRT for OS applications

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
flash
Member
Member
Posts: 29
Joined: Sun Feb 04, 2007 6:33 am

Problem in emulating exceptions in CRT for OS applications

Post by flash »

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:

Code: Select all

void main()
{
	int i;
	try{
		i=0;
		i=i/i;
	}catch(int e){
		i=1;
	}
}
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.
Post Reply