Sign in to follow this  
jonbell

Studio .NET

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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').

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Alternatively, you could just do what most other applications do (or at least should) and include the DLL in your distribution package.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this