CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    231

    Linking with DLL using structured exceptions

    From MSDN:
    "We recommend that you not link objects compiled by using /EHa together with objects compiled by using /EHs in the same executable module."

    In my case, the main project is built with /EHsc. Can it cause problems if I link it to a library that was built with /EHa, even though that library is catching all exceptions (both synchronous and asynchronous) so that they don't propagate across the library boundary? Please explain...

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Linking with DLL using structured exceptions

    Since you are not throwing exceptions across dll boundaries, you are probably ok. Perhaps the recommendation was for the cases where dlls do throw exceptions?

  3. #3
    Join Date
    Aug 2006
    Posts
    231

    Re: Linking with DLL using structured exceptions

    Thanks for the reply.

    I think so too, but I would like to be certain. I was hoping someone here had already tried it and could share their experience.

    It must be fairly common! For example, libraries using the common library runtime need to be compiled with /EHa. These flags should be mixed in order to not miss out on optimizations.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured