Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

When Exception handling disabled...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ele - 14 Jun 2004 01:03 GMT
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::basic_string<_Elem,_Traits,
_Ax>::size_type,std::basic_string<_Elem,_Traits,_Ax>::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>

       ]
Carl Daniel [VC++ MVP] - 14 Jun 2004 05:31 GMT
> 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
Ele - 15 Jun 2004 18:17 GMT
> > When Exception handling disabled compiler still spits out "C++
> > exception handler used."  Why is that?
[quoted text clipped - 7 lines]
>
> -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?
Carl Daniel [VC++ MVP] - 15 Jun 2004 19:19 GMT
> 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
Jeff F - 15 Jun 2004 20:51 GMT
> > By specifying "/EHsc", the compile error gone. So, in this case, what
> > "/EHsc" switch does here to solve the problem? Is it enabling
[quoted text clipped - 10 lines]
> http://www.dinkumware.com/libdual_vc.html) can be used with exceptions
> disabled.

Or see www.stlport.org

Jeff

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.