Skip to content

Question when compiling source code with VC++

5 messages · cstrato, Duncan Murdoch, Simon Urbanek

#
Dear Duncan,

In your document "readme.packages.txt" you have a very helpful chapter 
on "Using Visual C++".
Please allow me to ask you one question: Why do you propose the option 
"/MT" instead of option "/MD"?
(To my knowledge usually option "/MD" is used when compiling programs 
with VC++.)

Best regards
Christian
_._._._._._._._._._._._._._._._._._
C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
V.i.e.n.n.a           A.u.s.t.r.i.a
e.m.a.i.l:        cstrato at aon.at
_._._._._._._._._._._._._._._._._._
#
On 15/10/2009 5:01 PM, cstrato wrote:
I didn't write that: I've got no experience with VC++.  It was Brian 
Ripley who wrote it, and the log says he wrote it in 1999.  So I'd guess 
that it isn't bad advice (having lasted 10 years without a change), but 
I guess it's possible that it is no longer optimal.

Duncan Murdoch
#
Thank you for this clarification, neither did I know that it was written 
by Brian Ripley (although now this seems to be obvious) nor that the 
advice is already 10 years old. Thus please allow me to re-phrase my 
question:

Dear Prof. Ripley:
1, Why did you propose the option "/MT" instead of option "/MD"?
2, Will the proposed settings to build the DLL still be valid for the 
upcoming Windows 7?

Best regards
Christian
_._._._._._._._._._._._._._._._._._
C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
V.i.e.n.n.a           A.u.s.t.r.i.a
e.m.a.i.l:        cstrato at aon.at
_._._._._._._._._._._._._._._._._._
Duncan Murdoch wrote:
#
On Oct 15, 2009, at 17:01 , cstrato wrote:

            
Have you read the MS docs? They have different purposes - /MD pulls in  
MSVCR which may not be what you want (depending on your code), /MT  
just says that you want thread-safe libs. The fact that something is  
"usually" used is not necessarily a very good indicator -- it's better  
if you know what you're doing ;).

Cheers,
Simon
#
Dear Simon,

Of course I have read the MS docs, especially:
http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
which says, that /MT uses the multithread, static version of the 
run-time library.
As far as I understand this is not what most people want since to my 
knowledge most programs seem to use the /MD option.

I also know that option /MT works pretty well for source code of 
R-packages compiled for Windows XP. My second question is if it will 
also work with Windows 7 which I do not have yet.

Furthermore, you may have realized that since some time I am trying to 
find out why in my case neither option works on Vista, see my more 
detailed question at:
https://stat.ethz.ch/pipermail/r-devel/2009-September/054843.html
If you have any idea in this case I would appreciate it very much.

Best regards
Christian
Simon Urbanek wrote: