Sign in to follow this  
Cailen

How Do I Create an Executable

Recommended Posts

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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

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