Single-threaded versus Multithreaded
-
Hi everyone, I am busy creating a little setup project and run into a problem when compiling the debug version into a release version. (LNK4098 linker warning) My question is what is the difference between Single-threaded and Multithreaded CRT options in the compiler and when do I choose which one ? (My project do spawn a second thread apart from the main running thread.) Regards Ramsus Carpe Deum
-
Hi everyone, I am busy creating a little setup project and run into a problem when compiling the debug version into a release version. (LNK4098 linker warning) My question is what is the difference between Single-threaded and Multithreaded CRT options in the compiler and when do I choose which one ? (My project do spawn a second thread apart from the main running thread.) Regards Ramsus Carpe Deum
If you're using the CRT from multiple threads, use the multithreaded version. If not, the singlethreaded version is smaller and slightly quicker.
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
Hi everyone, I am busy creating a little setup project and run into a problem when compiling the debug version into a release version. (LNK4098 linker warning) My question is what is the difference between Single-threaded and Multithreaded CRT options in the compiler and when do I choose which one ? (My project do spawn a second thread apart from the main running thread.) Regards Ramsus Carpe Deum
It depends... Ryan gave a good answer, in ideal [single threaded] circumstances you should choose to use the single threaded crt libraries. rules of thumb * If there is any chance that in the future any part of the project may be multithreaded I recommend setting the options for the project to use the multi-threaded libraries. From past experience, it's easier to tell everyone else on the team what the setting should be rather than trying to let them figure it out (or change it) on their own. * If any of your dependancies are distributed as binaries linked against a particular crt, you MUST link against the same type. * If you don't want to distribute any .dll's with you product, statically link to the crt.