Results 1 to 1 of 1
Hi All,
I wanted to know how can i debug a file by compiling the code with "-E" (pre- processor ) option.
I wrote a sample program as follows
#include ...
- 09-19-2008 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 9
How to debug with -E flag in Gcc
Hi All,
I wanted to know how can i debug a file by compiling the code with "-E" (pre- processor ) option.
I wrote a sample program as follows
#include <iostream>
using namespace std;
int main ()
{
#ifdef FLG1
int Flg1 = 1;
cout <<" In Flg1 Init Flg =>" << Flg1 <<endl;
return 1;
#elif
int Flg2 = 1;
cout <<" In Flg2 Init Flg =>" << Flg2 <<endl;
return 2;
#endif
}
I compiled the program as follows
g++ -E -DFLG1 Test.cpp > temp
I got a huge output file temp. From this file how can i that the compilation directive FLG1 has been defined.
Can any one help me to know this.
Thanks & Regards
Vikram


Reply With Quote