The "-fexceptions" switch enables exception handling in the GCC compiler by default. According to the GCC compiler documentation, this can produce significant data size overhead. The "-fno-exceptions" switch disables exception handling.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-02-03
hmm thanks for the explanation but i mean i have a code which is:
#include <stdio.h>
#include <conio.h>
#define CR 13 /* this defines CR to be 13 */
#define LF 10 /* this defines LF to be 10 */
int main()
{
int c;
printf("Input any characters, hit X to stop.\n");
do
{
c = _getch(); /* get a character */
putchar(c); /* display the hit key */
if (c == CR) putchar(LF); /* if it is a carriage return */
/* put out a linefeed too */
} while (c != 'X');
printf("\nEnd of program.\n");
return 0;
}
/* Result of execution
Input any characters, hit X to stop.
(The output depends on what characters you enter.)
End of program.
*/
so it gaves an error which is:
[Linker error] undefined reference to `__gxx_personality_v0'
so i change the value to Yes for "support all Ansi C standard programs...
then the error changes to:
C:\C++\003\BETTERIN.C
[Warning] In function `int main()':
15 C:\C++\003\BETTERIN.C
`_getch' undeclared (first use this function)
[Build Error] (Each undeclared identifier is reported only once for
It compiles as either a C++ or a C program with no errors. Notive that my compile options do not involve "-fno-exceptions". (It compiles if I turn it on also)
I just copied your code, created a new source file, pasted and compiled.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Lars, I am not sure he is going to believe me that the road he was looking on was not the right road.
I was able to compile and run his code with both gcc and g++ by the way. Kinda makes sense since it is written as essentially C code.
I actually ran into that error the other day through another path. I had loaded an example project and run it. I then sorta lost track of what I was doing, and did a reload of another program, while the project was still there. When I tried to compile the stand alone code, I got the error....which was the first time I had seen it.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is "-fno-exceptions" ???
The "-fexceptions" switch enables exception handling in the GCC compiler by default. According to the GCC compiler documentation, this can produce significant data size overhead. The "-fno-exceptions" switch disables exception handling.
Wayne
hmm thanks for the explanation but i mean i have a code which is:
#include <stdio.h>
#include <conio.h>
#define CR 13 /* this defines CR to be 13 */
#define LF 10 /* this defines LF to be 10 */
int main()
{
int c;
printf("Input any characters, hit X to stop.\n");
do
{
c = _getch(); /* get a character */
putchar(c); /* display the hit key */
if (c == CR) putchar(LF); /* if it is a carriage return */
/* put out a linefeed too */
} while (c != 'X');
printf("\nEnd of program.\n");
return 0;
}
/* Result of execution
Input any characters, hit X to stop.
(The output depends on what characters you enter.)
End of program.
*/
so it gaves an error which is:
[Linker error] undefined reference to `__gxx_personality_v0'
so i change the value to Yes for "support all Ansi C standard programs...
then the error changes to:
C:\C++\003\BETTERIN.C
[Warning] In function `int main()':
15 C:\C++\003\BETTERIN.C
`_getch' undeclared (first use this function)
[Build Error] (Each undeclared identifier is reported only once for
so i opened the ANSI option and make an improvement but couldn't make the "-fno-exceptions" ok, as Hank said in http://sourceforge.net/forum/message.php?msg_id=1838752
??? So what is the problem about the exceptions???
I think there is another issue. Your code compiles here with no errors:
Executing gcc.exe...
gcc.exe "C:\My Documents\testit3.c" -o "C:\My Documents\testit3.exe" -lgsl -g3 -g3 -I"C:\DEV-CPP\include" -L"C:\DEV-CPP\lib" -L"c:\dev-cpp\include"
Execution terminated
Compilation successful
It compiles as either a C++ or a C program with no errors. Notive that my compile options do not involve "-fno-exceptions". (It compiles if I turn it on also)
I just copied your code, created a new source file, pasted and compiled.
Wayne
Excuse my butting in, but:
It seems I've had similar experiences that were caused by my file extension of the source file.
Is your source file somethinglikethis.C or somethinglikethis.c?
The compiler only recognizes somethinglikethis.c as a native C program. Otherwize g++ is invoked.
Hope it helps.
/Lars.
Thanks Lars, I am not sure he is going to believe me that the road he was looking on was not the right road.
I was able to compile and run his code with both gcc and g++ by the way. Kinda makes sense since it is written as essentially C code.
I actually ran into that error the other day through another path. I had loaded an example project and run it. I then sorta lost track of what I was doing, and did a reload of another program, while the project was still there. When I tried to compile the stand alone code, I got the error....which was the first time I had seen it.
Wayne