{"id":4017,"date":"2014-03-30T07:12:59","date_gmt":"2014-03-30T07:12:59","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/backward-compatability-of-libraries-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:12:59","modified_gmt":"2014-03-30T07:12:59","slug":"backward-compatability-of-libraries-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/backward-compatability-of-libraries-collection-of-common-programming-errors\/","title":{"rendered":"Backward compatability of Libraries.-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn Problem Description :\u00a0 Assume we have legacy product with following components. main.exe , x.dll (lib ) , y.dll ( lib ) , z .dll ( lib ) and miscellaneous.dll . Note : this product is very old legacy product ( 10 + years old ) , for which we have source code for all components said above . \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 But for miscellaneous.dll ( lib ) , we don&#8217;t have it&#8217;s source code , we have only it&#8217;s binaries.We are trying to upgrade this prodcut build from VC++6.0 to VS2005. Since miscellaneous.dll for which we have only binaries,\u00a0 we can&#8217;t build it using VS2005. so thought of going for below solution . Solution approached :<\/p>\n<p>Backward Compatibility\u00a0<\/p>\n<p>For compatibility between product versions, the library OLDNAMES.LIB maps old names to new names. For instance, <b>open<\/b> maps to <b>_open<\/b>. You must explicitly link with OLDNAMES.LIB only when you compile with the following combinations of command-line options:<\/p>\n<ul>\n<li>\n<p><b>\/Zl<\/b> (omit default library name from object file) and <b>\/Ze<\/b> (the default &#8211; use Microsoft extensions)<\/p>\n<\/li>\n<li>\n<p><b>\/link<\/b> (linker-control), <b>\/NOD<\/b> (no default-library search), and <b>\/Ze<\/b><\/p>\n<\/li>\n<\/ul>\n<p>For more information about compiler command-line options, see Compiler Reference.<\/p>\n<p>As said above , i&#8217;m planning to build all the components ( main.exe , x.dll , y.dll , z.dll ) with VS2005\u00a0 with normal compiling options and using \/Zl , \/Zc:wchar_t- , \/Ze options in compile time. Trying to link with necessary options and \/NODEFAULT ( to avoid linking with default library )\u00a0 and OLDNAMES.LIB.Libraries used in linking are : msvcrt.lib , oldnames.lib , kernel32.lib, advapi32.lib , shell32.lib, uuid32.lib , I&#8217;m hitting runtime failures, memory corruption problems ,error&#8217;s like not able to load CRT properly and CRT_INITIALIZATION routines are called twice. How can I support my old libraries which are built using VA6.0 in my VS2005 application (exe&#8217;s &amp; dll&#8217;s ) ?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn1 Using the VC6 compiler you might be able to add a wrapper which is callable from VC8.<\/p>\n<p>Generally you are better off re-implementing the library.<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn2<\/p>\n<p>Is there a way to support a old library ( built using VA6.0) for an exe which is built using VS2005 ?<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn3 Using the VC6 compiler you might be able to add a wrapper which is callable from VC8.<\/p>\n<p>Generally you are better off re-implementing the library.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>msdn Problem Description :\u00a0 Assume we have legacy product with following components. main.exe , x.dll (lib ) , y.dll ( lib ) , z .dll ( lib ) and miscellaneous.dll . Note : this product is very old legacy product ( 10 + years old ) , for which we have source code for all [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4017","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4017"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4017\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}