Compile C ++ from VS08 / 10 without runtime / MFC library

Could the settings I can tweak in Visual Studio so they don't compile with any runtime library or MFC. I started learning C ++ to get away from C # .Net and it's just as bad. When I run the program in a Windows XP virtual machine, I get an error. I can compile without dependencies in Code :: Blocks, but I am more familiar with VS and prefer many of its features over Code :: Blocks. If you know to get past this it would be quite helpful. Thanks.

+2


a source to share


2 answers


You can simply reference the static version of the CRT; just go to the project properties and set the Release configuration to "multithreaded (/ MT)" CRT instead of "Multithreaded DLL (/ MD)" (you can leave the debug configuration yourself, since you will run it on your machine). This way, your executable will only depend on "safe" system DLLs; obviously this will cause your executable to grow quite a bit (for example, a small console application that I needed to run without dependencies grew from ~ 32KB to ~ 200KB).



If you just want to go without any standard library instead, you will need to enable the "Ignore default libraries" option (or something similar, among the linker options), but keep in mind that this way you will have almost no no funds.

+4


a source


You didn't say which executable you are trying to build. Is it command line, windows winforms, etc.?



You can also browse NetBeans Projects and Eclipse IDE for C ++ Projects.

0


a source







All Articles