Setting up Microsoft Visual C++ 2010 Express for Orbiter/OrbiterSDK



Setting up Microsoft Visual C++ 2010 Express for Orbiter/OrbiterSDK


Source: video “Orbiter: Setting up the development environment” byMohd Ali
http://www.youtube.com/watch?v=VBRLkN__YIo

Start Orbiter
Extra - Debugging - Debugging options - shutdown options: Terminate
Lower the level of graphic detail (optional)
Close Orbiter

Start Visual C++ 2010
New project
Select empty template
Project name: TestProject
Location: (yourpath)\orbiter\orbiterSDK\samples
Create directory for solution: (leave) unchecked
OK

Right click Source Files
New CPP file: main.cpp

Copy to your main.cpp and save:
#define STRICT
#define ORBITER_MODULE

#include <Orbitersdk.h>

DLLCLBK void opcPreStep(double simt, double simdt, double mjd)
{
sprintf(oapiDebugString(), "%.2f", oapiGetSimTime());
}

Right click the bold TestProject, select properties
Set the following:
- Configuration Properties
- General
Configuration type: .dll
- Debugging
Command: (yourpath)\orbiter\Orbiter.exe
Working directory: ..\..\..

- C/C++
- General
Additional Include Directories: ..\..\include
- Code generation
Runtime Library: Multi-threaded (/MT)
- Linker
- General
Output File: ..\..\..\Modules\Plugin\test.dll
Additional Library Directories: ..\..\lib
- Input
Ignore Specific Library: msvcirt.lib, msvcrt.lib

Right click the bold TestProject
Add existing
browse to (yourpath)\orbiter\orbiterSDK\lib
Select and add orbiter.lib and Orbitersdk.lib

Hit the green play button
Ignore warning, continue
Orbiter starts
In Modules check 'test'
Click Launch Orbiter, simulation time should become visible left bottom.

To be clear:
- (yourpath) refers to the path where your Orbiter directory is. For example, if you have C:\Stuff\Apps\Orbiter\Orbiter.exe then (yourpath) would be C:\Stuff\Apps.
- Paths like ..\..\ are as they are.
- VC++ also works with Orbiter_ng.exe (debugging, command) if you prefer the DX9 client.