Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redist dependency with /MT #660

Closed
1364529444 opened this issue Feb 2, 2018 · 11 comments
Closed

Remove redist dependency with /MT #660

1364529444 opened this issue Feb 2, 2018 · 11 comments

Comments

@1364529444
Copy link

compile the exe and dlls with /MT param,not /MD pls.
and then any extra run-time dlls(vcpxxxx.dll,etc) needed.

@dokan-dev dokan-dev deleted a comment from 1364529444 Feb 2, 2018
@Liryna
Copy link
Member

Liryna commented Feb 2, 2018

Hi @1364529444 ,

With MD executable are smaller, people can update by just replacing the library, no issue with shared memory.
I think the difference is only about taste, no ? Or you see a real issue by using MD ?

@Liryna Liryna added the Question label Feb 2, 2018
@mccoysc
Copy link

mccoysc commented Feb 4, 2018

if compiled in /MT,the exe and dll can run without any vc runtime requirements. and you said "shared memory",in fact,it's a bad code style that malloc/new memory in on module and free/delete in another module.

@Liryna
Copy link
Member

Liryna commented Feb 6, 2018

Thank you @mccoysc for the input. I will make some test and see about it 👍

@atanamir
Copy link

If I may add my 2 cents, it's best to distribute both flavors (MD and MT). If you look at boost's nuget binaries for windows, they release both. In our case, we link our dokan FS code with other libraries also compiled with /MD, so having a /MD-compiled dokan static library is important for us.

@mccoysc
Copy link

mccoysc commented Mar 10, 2018 via email

@atanamir
Copy link

atanamir commented Mar 10, 2018

yes, but it's not recommended. It's best if they all use the same; the goal of /MD is to reduce binary size, and that only works when everything is linked in using /MD. Again, both /MD and /MT should be distributed together, and the devs can pick which one to use.

The compielr warns you when you mix them:

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
(This is if your library is /MT and your exe is /MD)

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
(If the library is MT and your executable is MT)

@mccoysc
Copy link

mccoysc commented Mar 10, 2018 via email

@atanamir
Copy link

There's definitely pros and cons to either approach. Dynamic linking of the C++ library allows your application to receive any patches they release to the runtime libraries in the future, whereas /MT will not. I prefer MD to MT, every person is entitled to their preference. Again, as I've mentioned, both should be distributed, not one or the other.

@mccoysc
Copy link

mccoysc commented Mar 10, 2018 via email

@Liryna
Copy link
Member

Liryna commented Mar 10, 2018

Hi @atanamir , @mccoysc ,

Having MT and MD binaries in release would be a good idea. As currently we use MD, I would propose to have MT binaries in a subfolder of the release/installer.
Does one of you would be interested to do a PR for it ?

@Liryna
Copy link
Member

Liryna commented Jun 1, 2020

The new release include has a installer without the VC redist dependency
See the installer with noVC https://github.com/dokan-dev/dokany/releases/tag/v1.4.0.1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants