Thursday, April 28, 2011

Quick Question: Why do VC++ compiled exe's stop working if I change their names?

I'm working on a command prompt roguelike in VisualC++ 2008, and everything compiles all fine and dandy, but there's one glaring issue that I have with it.

Why is it that if I change the name of the exe, the program fails completely? I don't think that's supposed to happen with most programs

From stackoverflow
  • It doesn't happen unless the program itself is designed to check its own exe's name and behave differently accordingly. You need to post some code.

  • It's most likely because of the manifest file - you'll either need to rename the manifest file as well or embed it into the exe, see http://support.microsoft.com/kb/944276

    cmeerw : Can you give some examples of these crazy linker errors?
    sylvanaar : you are trying to link the non-debug c runtime with your program which was compiled for the debug c runtime. are you compiling /MT and defining _DEBUG?
    Soo Wei Tan : You have runtime library conflicts... see this MSDN article for more information. http://msdn.microsoft.com/en-us/library/6wtdswk0(VS.80).aspx
    Jim Buck : Also, if you are sending your friends a debug .exe, and they don't have Visual Studio installed, then you need to also send them the debug runtime .dlls.
    Soo Wei Tan : IANAL, but I think it is against the VS EULA to distribute debug runtime DLLs. If you have any more "Application configuration" issues, you probably need them to have the appropriate VC runtime redistributable file. It's part of your VS installation or available on Microsoft's website.

0 comments:

Post a Comment