views:

62

answers:

4

I need to make a static release of my program to turn in to my professor, but whenever I compile the program and then run it on another computer it tells me it couldn't find a dll so obviously I'm doing something wrong. What do I need to do to make a static build?

A: 

After you change the project settings to a static build, choose Build All (or Rebuild All). If that doesn't work, choose "Delete all intermediate files" and build.

wallyk
A: 

Problems loading .dll dependencies usually stem from one of two issues:

  • Assemblies are missing in the GAC.
  • Assemblies are missing in the application directory.

In this case, my bet is that you can resolve the problems by ensuring the following:

  • Provide to your professor all assemblies that are copied to your output folder as a package.
  • Ensure your professor has the proper dependencies installed. For example, if your application is .NET, ensure that your professor has installed the correct .NET framework (probably .NET 4, if this is the case).
kbrimington
A: 

If you are compiling a C/C++ program look at a vcredist exe executable in your compiler's installation directory. This redistributable contains side-by-side assemblies needed to run your application. It is specific to the version of the compiler you are using. When you make a setup or deploy you have to install this on the target computer. Also do not forget to compile a "release". A "debug" won't run on other machines without having the debug dlls installed there, which are not part of the vcredist.

Here is a link to the vcredist on microsoft's site. You have to take the one exactly matching the compiler you are using. Better is to take the one from the installation dir of the compiler to be sure it matches.

jdehaan
A: 

I fixed it. I just copied the necessary dll files into the same folder as the exe and now it runs on any computer. Thanks for the help everyone!

Jason Kirby
Do you understand why this might not be a correct "solution"?
DaveE
Yeah, I figured out that this was a bad idea. The real solution was to go to the project settings and change the release format from MultiThreaded DLL to plain MultiThreaded... But now I know!
Jason Kirby