[M3devel] cm3 linking to Visual C++ runtime

Jay K jay.krell at cornell.edu
Sun Feb 28 23:46:49 CET 2016


Sorry, I forgot, I already did this:
 
NT.common:
 
    if USE_MSVCRT
        SYSTEM_LIBS{"LIBC"} += [LibIn("msvcrt")]
        if equal ($CM3_VS2015_OR_NEWER, "1")
            SYSTEM_LIBS{"LIBC"} += [LibIn("vcruntime")]
            SYSTEM_LIBS{"LIBC"} += [LibIn("ucrt")]
        end
    else
        SYSTEM_LIBS{"LIBC"} += [LibIn("libcmt")]
        if equal ($CM3_VS2015_OR_NEWER, "1")
            SYSTEM_LIBS{"LIBC"} += [LibIn("libvcruntime")]
            SYSTEM_LIBS{"LIBC"} += [LibIn("libucrt")]
        end
    end



so:
set CM3_VS2015_OR_NEWER=1
 
in your environment. Easy enough? I'm not sure.
 
 - Jay

 
From: jay.krell at cornell.edu
To: dmuysers at hotmail.com; m3devel at elegosoft.com
Date: Sun, 28 Feb 2016 22:39:15 +0000
Subject: [M3devel] cm3 linking to Visual C++ runtime




 For a very long time, to link the Visual C++ C runtime library, you linked to one of: 
  
  libcmt.lib -- static C runtime 
  msvcrt.lib -- import library for dynamic C runtime, and static startup code
  libcmtD.lib - debug static C runtime 
  msvcrtD.lib -- import library for debug dynamic C runtime, and static startup code 
 
 
 This changes with Visual C++ 14/2015. 
 The C runtime has been split into three pieces. 
 I believe you have to link to three libraries. 
   msvcrt.lib ucrt.lib vcruntime.lib 
  OR: 
   libcmt.lib libucrt.lib libvcruntime.lib 

 
 Part of the rationale here is to actually slow down the rate of change. 
 Previously, the entire C runtime was revised with every release.
 Now, a large chunk of it has been moved out into the "operating system" 
 and will remain compatible with all toolsets. That is the "ucrt" part. 
 U is for universal. 
 

"makefile breakage" is unfortunate. 

 
  I'm not sure what to do in the config files, to automatically work with anything.  
  Perhaps remove the /nodefaultlib.  
  /nodefaultlib has a lot of precedent in multiple systems, but so does not using it.  
 
  
  For now, please adjust your config files.  
 
  
  Probably removing /nodefaultlib is the right thing. 
 
 A long time ago, there were cm3 releases set to use the non-thread-safe C runtime. 
 /nodefaultlib was needed to workaround that.  
 The non-thread-safe C runtime has not now existed for a while. 
 

 - Jay 
 

 		 	   		  

_______________________________________________
M3devel mailing list
M3devel at elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20160228/59854cfc/attachment-0002.html>


More information about the M3devel mailing list