Compiling and running DirectX: Some pitfalls
I’ve sometimes had problems running the DirectX programs I make on other computers. I usually compile under a Debug configuration (using Visual Studio 2005). I can use the Debug option in Visual Studio to run the programs, and they work fine; I can even use Explorer to find the binaries and run them directly. However, when I give the binaries to someone else, they invariably get the oh-so-helpful “This application is configured incorrectly, reinstalling it may fix the problem”.
I believe I’ve figured out the real problem, and it’s actually pretty simple. I can run these binaries because I have the developer version of DirectX installed. The developer version has debug versions of all the libraries and DLLs. Therefore, I can run things compiled in a debug configuration…But most people only have the regular end-user version, and thus they can’t run my binaries. I have to compile a Release version in a Release configuration to get a binary someone else can run.
And today the problem extended even further. I was linking in a library (a Lua library, actually) that had been compiled in a debug configuration. Even though Lua had nothing to do with DirectX, I was still having the same error. However, when I compiled a release version of the Lua library and linked that, I was able to get the program to run on other computers.
So, if you’ve ever had this problem, try compiling in a Release configuration.
In other news, Secret Project 1 is going well…