By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

When Exception handling disabled...

P: n/a
Ele
When Exception handling disabled compiler still spits out "C++ exception
handler used." Why is that?

Why does it ask for "Specify /EHsc"?

Thanks!

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(1453)
: warning C4530: C++ exception handler used, but unwind semantics are not
enabled. Specify /EHsc

c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xstring(1444) : while compiling class-template member
function 'void
std::basic_string<_Elem,_Traits,_Ax>::_Copy(std::b asic_string<_Elem,_Traits,
_Ax>::size_type,std::basic_string<_Elem,_Traits,_A x>::size_type)'

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Ax=std::allocator<char>

]

c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\stdexcept(39) : see reference to class template
instantiation 'std::basic_string<_Elem,_Traits,_Ax>' being compiled

with

[

_Elem=char,

_Traits=std::char_traits<char>,

_Ax=std::allocator<char>

]

Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Ele wrote:
When Exception handling disabled compiler still spits out "C++
exception handler used." Why is that?

Why does it ask for "Specify /EHsc"?


It's telling you that you're trying to compile code that requires exception
handling with exception handling disabled. Either change the code (in this
case, it's the standard library, so you can't really do that), or enable
exception handling.

-cd
Nov 17 '05 #2

P: n/a
Ele
Carl Daniel [VC++ MVP] <cp*****************************@mvps.org.nospam >
wrote in message news:Oa**************@tk2msftngp13.phx.gbl...
Ele wrote:
When Exception handling disabled compiler still spits out "C++
exception handler used." Why is that?

Why does it ask for "Specify /EHsc"?
It's telling you that you're trying to compile code that requires

exception handling with exception handling disabled. Either change the code (in this case, it's the standard library, so you can't really do that), or enable
exception handling.

-cd

Thanks Carl.

By specifying "/EHsc", the compile error gone. So, in this case, what
"/EHsc" switch does here to solve the problem? Is it enabling exception
handling? What if exception handling has to be disabled and we have to use
the standard library, what shall we do then?
Nov 17 '05 #3

P: n/a
Ele wrote:
By specifying "/EHsc", the compile error gone. So, in this case, what
"/EHsc" switch does here to solve the problem? Is it enabling
exception handling?
Yes.
What if exception handling has to be disabled and
we have to use the standard library, what shall we do then?


You cannot use the standard library without exceptions. You can, however,
use a library a lot like the standard library without exceptions. I believe
that Dinkumware's Unabridged Library (see
http://www.dinkumware.com/libdual_vc.html) can be used with exceptions
disabled.

-cd
Nov 17 '05 #4

P: n/a

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:eg*************@TK2MSFTNGP11.phx.gbl...
Ele wrote:
By specifying "/EHsc", the compile error gone. So, in this case, what
"/EHsc" switch does here to solve the problem? Is it enabling
exception handling?
Yes.
What if exception handling has to be disabled and
we have to use the standard library, what shall we do then?


You cannot use the standard library without exceptions. You can, however,
use a library a lot like the standard library without exceptions. I

believe that Dinkumware's Unabridged Library (see
http://www.dinkumware.com/libdual_vc.html) can be used with exceptions
disabled.


Or see www.stlport.org

Jeff
Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.