Setting Up
From NaviWiki
Contents |
[edit]
Setting Your Project Up
Before we begin, make sure that you've completed the previous tutorial: Building from Source.
This tutorial assumes that you are already familiar with Ogre3D and can create a basic application with it. The aim of this tutorial is to instruct you on how to modify your existing project to utilize NaviLibrary.
[edit]
Add Includes to the Project
- Include the header Navi.h wherever you intend to use NaviLibrary.
#include "Navi.h"
- Open up the project properties dialog.
- Unroll the 'C/C++' tree, select 'General'.
- Select the 'Additional Include Directories' property and click the little '...' button that appears.
- You will need to specify two directories at this dialog:
- The includes directory for NaviLibrary. I unzipped my source release package in a folder named 'NaviLibrary' that is located one folder above my 'NaviPlayground' solution directory. So I typed:
$(SolutionDir)..\NaviLibrary\Navi\Include
- The includes directory for the Astral dependency that came with NaviLibrary. I typed:
$(SolutionDir)..\NaviLibrary\Dependencies\win32\astral\include
- The includes directory for NaviLibrary. I unzipped my source release package in a folder named 'NaviLibrary' that is located one folder above my 'NaviPlayground' solution directory. So I typed:
- Click OK.
- While still in the project properties dialog, select 'Release' from the 'Configuration' drop-down list that is at the top of the dialog. (If it asks you if you want to save your changes, click Yes)
- You will need to add the same include directories as you did earlier to this configuration. Click 'Apply' in the project properties dialog when finished.
[edit]
Add Library Dependencies to the Project
- You should still be in the project properties dialog.
- Go back to the 'Debug' configuration.
- Unroll the 'Linker' tree, select 'General'.
- Select the 'Additional Library Directories' property and click the little '...' button that appears.
- You will need to specify two directories at this dialog (déjà vu, huh):
- The directory that holds your built NaviLibrary libraries (.lib's). Again, I unzipped and built my source release package in folded named 'NaviLibrary' that is located one folder above my current solution's directory. So I typed:
$(SolutionDir)..\NaviLibrary\Navi\Lib
- The directory that holds the Astral libraries (.lib's) that came with NaviLibrary. I typed:
$(SolutionDir)..\NaviLibrary\Dependencies\win32\astral\lib
- The directory that holds your built NaviLibrary libraries (.lib's). Again, I unzipped and built my source release package in folded named 'NaviLibrary' that is located one folder above my current solution's directory. So I typed:
- Click OK.
- Still in the 'Linker' tree, select 'Input'.
- Select the 'Additional Dependencies' property and add:
Navi_d.lib Astral_d.lib
- Note: If you wish to link Navi as a DLL, you will need to specify Navi_d_DLL.lib instead of Navi_d.lib.
- Click 'Apply' when done.
- While still in the project properties dialog, select 'Release' mode once again. (If it asks you if you want to save your changes, click Yes)
- You will need to repeat the same steps you completed just now in this configuration except for one thing:
- For the 'Additional Dependencies' property, you will need to add:
Navi.lib Astral.lib
- Note: As before, if you wish to link Navi as a DLL, you will need to specify Navi_DLL.lib instead of Navi.lib.
- For the 'Additional Dependencies' property, you will need to add:
- Click OK in the project properties dialog when finished.
[edit]
Copy Runtime Dependencies
- Open up your 'debug' target directory.
- You will now need to copy the necessary debug runtime to this folder:
- If you linked Navi as a DLL, you will need to copy Navi_d.dll to this folder. (If you built NaviLibrary with the Debug DLL configuration, it should be in NaviLibrary\Navi\Lib)
- The astral debug runtime. Copy the contents of NaviLibrary\Dependencies\win32\astral\runtime\Debug to this folder. (Make sure you've also copied the 'GeckoRuntime' folder)
- Now we need to copy the release runtime, so go back and open up your 'release' target directory now.
- You will now need to copy the necessary release runtime to this folder:
- If you linked Navi as a DLL, you will need to copy Navi.dll to this folder. (If you built NaviLibrary with the Release DLL configuration, it should be in NaviLibrary\Navi\Lib)
- The astral release runtime. Copy the contents of NaviLibrary\Dependencies\win32\astral\runtime\Release to this folder. (Make sure you've also copied the 'GeckoRuntime' folder)

