CFile C++ exceptions in EVT3.0
-
I am writing for PocketPC 2002 using Embedded Visual Tools 3.0 (EVT3.0). The on-line documentation for CFile::Write() says "Write throws an exception in response to several conditions, including the disk-full condition." When I compile a try{ cfile->Write(...) } catch{...} code segment, the compiler flags the first of several cfile->Write() statements with: "... warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX". My problem is where to insert this switch in the EVT3.0 environment? I've found prerelease MSDN documentation on Structured Exception Handling , which says "Structured exception handling works with C and C++ source files. However, it is not specifically designed for C++. Although destructors for local objects will be called if you use structured exception handling in a C++ program (if you use the /GX compiler option), you can ensure that your code is more portable by using C++ exception handling. The C++ exception handling mechanism is more flexible, in that it can handle exceptions of any type." BUT, I think they're referring to Visual Studio 5 or 6, which has a slightly different Project interface than EVT3.0. I also get the following linker errors due to the try/catch segment: "error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@) error LNK2001: unresolved external symbol ___CxxFrameHandler" Does anybody know how to make EVT3.0 happy here? Thanks Mike Landis
-
I am writing for PocketPC 2002 using Embedded Visual Tools 3.0 (EVT3.0). The on-line documentation for CFile::Write() says "Write throws an exception in response to several conditions, including the disk-full condition." When I compile a try{ cfile->Write(...) } catch{...} code segment, the compiler flags the first of several cfile->Write() statements with: "... warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX". My problem is where to insert this switch in the EVT3.0 environment? I've found prerelease MSDN documentation on Structured Exception Handling , which says "Structured exception handling works with C and C++ source files. However, it is not specifically designed for C++. Although destructors for local objects will be called if you use structured exception handling in a C++ program (if you use the /GX compiler option), you can ensure that your code is more portable by using C++ exception handling. The C++ exception handling mechanism is more flexible, in that it can handle exceptions of any type." BUT, I think they're referring to Visual Studio 5 or 6, which has a slightly different Project interface than EVT3.0. I also get the following linker errors due to the try/catch segment: "error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@) error LNK2001: unresolved external symbol ___CxxFrameHandler" Does anybody know how to make EVT3.0 happy here? Thanks Mike Landis
Mike Landis wrote: Does anybody know how to make EVT3.0 happy here? You don't because eVC++ 3.0 does not support C++ exceptions, only structured exceptions. Regards, João Paulo Figueira Embedded MVP