Studio .NET

Started by
6 comments, last by GameDev.net 19 years, 8 months ago
Is it possible to stop C++ .net building in program dependencies to the .net framework (i am obviously not using the .net framework). Frankly i find it apalling that an Opensource dll that i built with C++ .net suddenly has a dependeny on the .net framework as does every other exe that I compile.
Advertisement
Yes. Just choose "Win32 Project" instead of ".NET Project", or modify the project options manually (remove the /clr switch or set 'use managed extensions' in the 'general' tab to 'no').
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I have chosen Win32 app and MFC app and still the dependencies persist.

In the case of building Mozillas Java Script engine (which we all know does not use .net) i simply built with the make file provided and then when i came to use the output dll on my Windows 2000 machine (with no .net framework installed) i got a dependency error on startup (msvcr71.dll). I am not possitive that this dll is part of the .net framework but still Microsoft is building in unneeded dependencies. When i rebuilt Mozillas code with VC++ 6 everything was fine.

Another interesting thing i have found is that if you build a deployment project to install your app using .net, the setup file it produces will not install onto a machine without .net. All you get is an error box telling you to visit Microsoft.com and download the framework. How on earth are you supposed to distribute an App when this kind of crap is happening?
msvcr71.dll is not the .NET runtime. It's the 7.1 version of the C runtime (Microsoft Visual C Runtime 7.1).

If you want to eliminate that dependency, select Single-Threaded (/MS) or Multi-Threaded (/MT) (depending on the app) for C++/Code Generation/Runtime Library. That will statically link the C library into the application.

I have never created a 'deployment project' (now, that sounds unprofessional, doesn't it? [smile]), so I cannot help you with that, though it does indeed sound unusual.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Build it to link statically to the runtime library. It's the same with applications built using vc6.0. You've probably never noticed it because most people have msvcrt40.dll on their machines. You've been relying upon them having something installed to make your applications work for much longer than .net has been around.
Alternatively, you could just do what most other applications do (or at least should) and include the DLL in your distribution package.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I had a feeling that dll was not .net but my gripe about the setup project still stands :)


When you create a setup / deployment project from the projects menu it never tells you that the target machine needs to have the .net framework installed, however when you run the setup.exe that it generates it specifically tells you that it requires the .net framework. This is a great shame because the install projects are awesome and actually kick install shields ass (not that that is difficult most free install software kicks install shields ass as well).
Quote:Original post by jonbell
i got a dependency error on startup (msvcr71.dll). I am not possitive that this dll is part of the .net framework but still Microsoft is building in unneeded dependencies.


ROFL! If you google before posting you might not look this dumb.

This topic is closed to new replies.

Advertisement