Skip to main content
Visual Studio Debugging Settings - Shoggoth         Setting up debugging in Visual Studio - working directory and command - so that you can run your exe from within the IDE

Tip_icon.png This information is regarding previous versions of Ogre. (Before the switch to a CMake based build system)

Info See Building Ogre for current version.

Help! It doesn't work when I run my exe from Visual Studio!

Do not worry. All you have to do is adjust your project properties:
properties.jpg

Navigate to the debugging section and enter the following values in Command and Working Directory:
debugging.jpg

Now it should work!

Help! It still doesn't work!

So, where is your executable?

If it's being copied to another location, you can't use the $(OutDir) variable.

If you use the samples directory of the OgreSDK, you need to change the values in Command and Working Directory to the following:
Command : $(OGRE_HOME)\bin\$(ConfigurationName)\$(ProjectName).exe

Working Directory: $(OGRE_HOME)\bin\$(ConfigurationName)

You also need to setup your project to copy your executable to this location.
Open up Project - Properties - Build Events - Post Build Events:

Postbuildevent.jpg

The command line to enter is copy "$(OutDir)\$(TargetFileName)" "$(OGRE_HOME)\bin\$(ConfigurationName)".