[sword-devel] question about try/throw/catch in Embedded Visual C++

Chris Little sword-devel@crosswire.org
Sun, 14 Sep 2003 23:10:15 -0700 (MST)


Hi Mark,

To answer the question you didn't ask first, the RTDynamicCast errors were 
the result of compiling with RTTI turned on.  Fixing that required 
removing dependence on RTTI from the library.

As for the try/throw/catch errors, the fix is to simply remove them from 
code that gets sent to eVC++.  eVC++ doesn't have any exception handling 
support.  You can remove them by using #ifndef _WIN32_WCE (or 
whatever the variable name is for WinCE).  It might also be possibly to 
change e.g. try to tryMacro in the code, then use:

#ifndef _WIN32_WCE
#define tryMacro try
#else
#define tryMacro ""
#endif

Someone correct me if I'm wrong.

--Chris


On Sat, 13 Sep 2003, Mark Topinka wrote:

> 
> 
> Dear Chris-
>        I saw an ancient posting of yours on http://www.crosswire.org that I 
> was very curious about the answer to.  I apologize for contacting you out 
> of the blue like this, but I'm kind of at my wits end... if you could 
> possibly let me know what the resolution to these linker errors were, I 
> would very much appreciate it!!   (It seems that these linker errors pop up 
> when I try to use "try" or "throw" or "catch" in Embedded Visual C++ 3.0 
> code)  Thank you very very much in advance.  Sincerely, -Mark Topinka, 
> mtopinka@stanford.edu
> 
> 
> [sword-devel] Sword for CE problems
> 
> Chris Little <mailto:sword-devel%40crosswire.org>sword-devel@crosswire.org
> Sat, 27 Jan 2001 12:37:01 -0800
> 
>     * Previous message: <002015.htm>Re[2]: [sword-devel] ISO updates
>     * Next message: <002021.htm>[sword-devel] Available books of a module
>     * Messages sorted by: <date.htm#2020>[ date ] <thread.htm#2020>[ thread 
> ] <subject.htm#2020>[ subject ] <author.htm#2020>[ author ]
> 
> ----------
> 
> I've got Sword almost building in eVC++.  The compile works fine, but I'm
> still getting linker errors.  I've cleared up most of them, but am still
> getting the following list of errors.  Some of the later ones I can deal
> with.  For example, I'm not yet including zlib stuff, so (un)compress isn't
> yet resolving.  The ones I'm completely clueless about are "const
> type_info::`vftable'", "__RTDynamicCast", "__CxxFrameHandler", and
> "__CxxCatchReturn".  Does anyone know what these are or have any ideas how
> to fix these last errors?
> 
> I'm only 42 linker errors away from success. yay! :)
> 
> --Chris Little
> 
> 
> 
> sxl.lib(fclose.obj) : error LNK2005: fclose already defined in
> coredll.lib(COREDLL.dll)
> ztext.obj : error LNK2001: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@)
> rawtext.obj : error LNK2001: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@)
> swmodule.obj : error LNK2001: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@)
> versekey.obj : error LNK2019: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@) referenced in function "private:
> void __cdecl VerseKey::initstatics(void)" 
> (?<mailto:initstatics@VerseKey>initstatics@VerseKey@@AAAXXZ)
> zcom.obj : error LNK2019: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@) referenced in function "public:
> virtual __cdecl zCom::~zCom(void)" (??1zCom@@<mailto:UAA@XZ>UAA@XZ)
> hrefcom.obj : error LNK2001: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@)
> rawcom.obj : error LNK2001: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@)
> rawfiles.obj : error LNK2001: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@)
> rawgbf.obj : error LNK2019: unresolved external symbol "const
> type_info::`vftable'" (??_7type_info@@6B@) referenced in function "public:
> virtual __cdecl RawGBF::operator char *(void)" (??BRawGBF@@UAAPADXZ)
> ztext.obj : error LNK2001: unresolved external symbol __RTDynamicCast
> rawtext.obj : error LNK2001: unresolved external symbol __RTDynamicCast
> swmodule.obj : error LNK2001: unresolved external symbol __RTDynamicCast
> versekey.obj : error LNK2001: unresolved external symbol __RTDynamicCast
> zcom.obj : error LNK2019: unresolved external symbol __RTDynamicCast
> referenced in function "public: virtual __cdecl zCom::operator char *(void)"
> (??BzCom@@UAAPADXZ)
> hrefcom.obj : error LNK2019: unresolved external symbol __RTDynamicCast
> referenced in function "public: virtual char * __cdecl
> HREFCom::getRawEntry(void)" 
> (?<mailto:getRawEntry@HREFCom>getRawEntry@HREFCom@@UAAPADXZ)
> rawcom.obj : error LNK2019: unresolved external symbol __RTDynamicCast
> referenced in function "public: virtual char * __cdecl
> RawCom::getRawEntry(void)" 
> (?<mailto:getRawEntry@RawCom>getRawEntry@RawCom@@UAAPADXZ)
> rawfiles.obj : error LNK2001: unresolved external symbol __RTDynamicCast
> rawgbf.obj : error LNK2019: unresolved external symbol __RTDynamicCast
> referenced in function "public: virtual __cdecl RawGBF::~RawGBF(void)"
> (??1RawGBF@@<mailto:UAA@XZ>UAA@XZ)
> rawtext.obj : error LNK2001: unresolved external symbol __CxxFrameHandler
> swmodule.obj : error LNK2001: unresolved external symbol __CxxFrameHandler
> zcom.obj : error LNK2019: unresolved external symbol __CxxFrameHandler
> referenced in function "public: virtual __cdecl zCom::operator char *(void)"
> (??BzCom@@UAAPADXZ)
> ztext.obj : error LNK2001: unresolved external symbol __CxxFrameHandler
> hrefcom.obj : error LNK2019: unresolved external symbol __CxxFrameHandler
> referenced in function "public: virtual __cdecl HREFCom::~HREFCom(void)"
> (??1HREFCom@@<mailto:UAA@XZ>UAA@XZ)
> rawcom.obj : error LNK2001: unresolved external symbol __CxxFrameHandler
> rawfiles.obj : error LNK2001: unresolved external symbol __CxxFrameHandler
> rawgbf.obj : error LNK2001: unresolved external symbol __CxxFrameHandler
> rawtext.obj : error LNK2001: unresolved external symbol __CxxCatchReturn
> swmodule.obj : error LNK2001: unresolved external symbol __CxxCatchReturn
> zcom.obj : error LNK2001: unresolved external symbol __CxxCatchReturn
> ztext.obj : error LNK2001: unresolved external symbol __CxxCatchReturn
> hrefcom.obj : error LNK2019: unresolved external symbol __CxxCatchReturn
> referenced in function "public: virtual char * __cdecl
> HREFCom::getRawEntry(void)" 
> (?<mailto:getRawEntry@HREFCom>getRawEntry@HREFCom@@UAAPADXZ)
> rawcom.obj : error LNK2001: unresolved external symbol __CxxCatchReturn
> rawfiles.obj : error LNK2001: unresolved external symbol __CxxCatchReturn
> rawgbf.obj : error LNK2001: unresolved external symbol __CxxCatchReturn
> sapphire.obj : error LNK2019: unresolved external symbol "void * __cdecl
> memset(void *,int,unsigned int)" 
> (?memset@@<mailto:YAPAXPAXHI@Z>YAPAXPAXHI@Z) referenced in
> function "public: void __cdecl sapphire::burn(void)"
> (?<mailto:burn@sapphire>burn@sapphire@@QAAXXZ)
> swmodule.obj : error LNK2019: unresolved external symbol regfree referenced
> in function "public: virtual class ListKey & __cdecl SWModule::Search(char
> const *,int,int,class SWKey *,bool *,void (__cdecl*)(char,void *),void *)"
> (?<mailto:Search@SWModule>Search@SWModule@@UAAA
> AVListKey@@PBDHHPAVSWKey@@<mailto:PA_NP6AXDPAX@Z3>PA_NP6AXDPAX@Z3@Z)
> swmodule.obj : error LNK2019: unresolved external symbol regexec referenced
> in function "public: virtual class ListKey & __cdecl SWModule::Search(char
> const *,int,int,class SWKey *,bool *,void (__cdecl*)(char,void *),void *)"
> (?<mailto:Search@SWModule>Search@SWModule@@UAAA
> AVListKey@@PBDHHPAVSWKey@@<mailto:PA_NP6AXDPAX@Z3>PA_NP6AXDPAX@Z3@Z)
> swmodule.obj : error LNK2019: unresolved external symbol regcomp referenced
> in function "public: virtual class ListKey & __cdecl SWModule::Search(char
> const *,int,int,class SWKey *,bool *,void (__cdecl*)(char,void *),void *)"
> (?<mailto:Search@SWModule>Search@SWModule@@UAAA
> AVListKey@@PBDHHPAVSWKey@@<mailto:PA_NP6AXDPAX@Z3>PA_NP6AXDPAX@Z3@Z)
> zipcomprs.obj : error LNK2019: unresolved external symbol compress
> referenced in function "public: virtual void __cdecl
> ZipCompress::Encode(void)" 
> (?<mailto:Encode@ZipCompress>Encode@ZipCompress@@UAAXXZ)
> zipcomprs.obj : error LNK2019: unresolved external symbol uncompress
> referenced in function "public: virtual void __cdecl
> ZipCompress::Decode(void)" 
> (?<mailto:Decode@ZipCompress>Decode@ZipCompress@@UAAXXZ)
> ARMRel/RapierBible.exe : fatal error LNK1120: 10 unresolved externals
> Error executing link.exe.
> Creating browse info file...
> 
> RapierBible.exe - 42 error(s), 0 warning(s)
> 
> 
>