How Do I Create an Executable

Started by
7 comments, last by Cailen 14 years, 2 months ago
I'm using Microsoft Visual Studio 2008, C++, and DirectX... I've tried opening the executable in both the 'Release' folder and the 'Debug' folder. However, I keep getting this error message: Unexpected error encountered Line: 283 Error Code: Unknown Calling: D3DX10CreateEffectFromFile Also, when running the program from Visual Studio it works fine Thanks in Advance
Advertisement
You have a bug in your code where the effect file cannot be found. Make sure you're giving the method the correct file name!
Sounds like when you run it from visual studio, it's setting the correct working directory for you.
Make sure that all the files that have the effect in them are in the same folder as the executable.

This is a typical mistake, the working directory has the effect file so the debugger can find it but the release and debug exe are alone in the folder.

Just copy the effect file across into all directories.

If you did appropriate error checking, you would be able to see/find out which file isn't loading.

PureBlackSin
For Games, Articles and Custom High End Computers, come visit.Myndoko
Yes the problem was that the effect file was not in the same directory as the executable. I knew that the problem was occuring because of the .fx file, I just thought that it was a code issue... So why is it that all of my .cpp and .h files do not need to be copied into this directory, but my .fx file does, even though my .fx file was part of the project... I'm assuming it has something to do with the 'Would you like to create a build rule' message that comes up when I go to add a .fx file to my project?
.h and .cpp files no longer matter once you compile. they get turned in to the .exe. Paths are relative to wherever the executable is located. Since the executable gets put in a sub directory you have to move files that "matter" into the correct relative path.

- me
I like to create a directory for my resources, which I usually call "root", in my project directory. In this directory, I create the same directory structure I expect the final game to use, and then I set it as the working directory for the project (be careful to do it for both debug and release settings.

Then, as a post-build step, I write a little batch file to copy the contents of the "root" directory into a drop folder (if you have a lot of files, you should only copy files which are newer) along with my executable and any dependancies that were built.

This will automate the process of building a working stand-alone set.

throw table_exception("(? ???)? ? ???");

I also create a "root" type directory.

However, I put all my actual content there and then change the project settings to just create the various executables in that directory. I change their name so it looks like: <ProjectName>Release.exe, <ProjectName>Debug.exe, <ProjectName>Profile.exe, etc

That way no content has to be copied anywhere. And it's easy to create a .zip of my project. Just zip up root and it's an installed game image.

-me
Great. Thanks for all the advice.

This topic is closed to new replies.

Advertisement