Hi, I have a doc/view app that I've always dynamically linked with MFC. I'm thinking about linking it statically, but I tried that and it compiles and links, but will not run. What are the 'gotchas' for static linking MFC?
cheers,
-Matt
Printable View
Hi, I have a doc/view app that I've always dynamically linked with MFC. I'm thinking about linking it statically, but I tried that and it compiles and links, but will not run. What are the 'gotchas' for static linking MFC?
cheers,
-Matt
why link it staticly? just makes bigger code. do you have other reasons it needs to be staticly linked?
miked
This is not totally true if you are going to distribute the application to a large audience of people who may or may not have the necessary DLL's. A statically linked EXE with MFC is much smaller than a dynamically linked version *plus* all of the DLL's that are needed to get the application working. I statically linked an MFC application and it was less than 300K.
Regards,
Paul McKenzie
To clarify, I need to link statically with MFC because I'm linking with other libraries that depend on libc.lib. libc.lib clashes with msvcrt.lib, and if I ignore msvcrt.lib, I will be missing a couple of symbols I need to link. Linking statically *should* solve this problem. I also want to link statically, because I've had problems with different users that have different versions of the MFC dlls on their computers, and my app will work on some, and not on others. Linking statically will solve that problem.
cheers,
-Matt
The only sane move on your part. Read my post. It sounds almost exactly like yours.
Regards,
Paul McKenzie