- Joined
- Jan 13, 2008
- Messages
- 2,302
- Reaction score
- 6
- Points
- 38
- Location
- Atlanta, GA, USA, North America
Ok, so I've decided to branch into the wonderful world of C++ Orbiter Programming. I got ShuttlePB to compile OK thanks to some guys on the IRC, but now that I've decided to create my own vessel from scratch, I've run into a few hiccups. I've been able to solve most of the initial errors, but these last few continue to elude me.
First is the .cpp file, second is a readout of all the errors.
Thanks for any help,
Zat
BTW-I'll be hangin' around the IRC till who knows when so if it's easier for you or whatever, just speak up there.
First is the .cpp file, second is a readout of all the errors.
Thanks for any help,
Zat
BTW-I'll be hangin' around the IRC till who knows when so if it's easier for you or whatever, just speak up there.
Code:
// This is the main DLL file.
#include "stdafx.h"
#include "SSM.h"
#include "orbitersdk.h"
#define ORBITER_MODULE
HINSTANCE g_hDLL;
DLLCLBK void InitModule(HINSTANCE hModule)
{
g_hDLL = hModule;
}
class _SSM: public VESSEL2
{
public:
_SSM (OBJHANDLE hObj, int fmodel): VESSEL2 (hObj, fmodel)
{
void clbkLoadStateEx (FILEHANDLE scn/*, void *status*/);
void clbkSaveState (FILEHANDLE scn);
void clbkSetClassCaps (FILEHANDLE cfg);
}
~_SSM () {}
PROPELLANT_HANDLE ph_main;
THRUSTER_HANDLE th_rcs[12];
// add more vessel methods here
void _SSM::clbkLoadStateEx (FILEHANDLE scn/*, void *status*/)
{
char *line;
while (oapiReadScenario_nextline (scn, line))
{
ParseScenarioLineEx (line, status);
}
}
void _SSM::clbkSetClassCaps (FILEHANDLE cfg)
{
const double MAX_MAIN_FUEL = 1e3;
const double THRUST = 2e5;
const double ISP = 3334.21;
SetEmptyMass (10000.0);
SetSize (10.0);
AddMesh (oapiLoadMeshGlobal ("SSM.msh"));
ph_main = CreatePropellantResource (MAX_MAIN_FUEL);
/*th_rcs[ 0] = CreateThruster (_V( 2.25,0, 3), _V(0, 1,0), THRUST, ph_main, ISP);
th_rcs[ 1] = CreateThruster (_V( 2.25,0, 3), _V(0,-1,0), THRUST, ph_main, ISP);
th_rcs[ 2] = CreateThruster (_V(-2.25,0, 3), _V(0, 1,0), THRUST, ph_main, ISP);
th_rcs[ 3] = CreateThruster (_V(-2.25,0, 3), _V(0,-1,0), THRUST, ph_main, ISP);
th_rcs[ 4] = CreateThruster (_V( 2.25,0,-3), _V(0, 1,0), THRUST, ph_main, ISP);
th_rcs[ 5] = CreateThruster (_V( 2.25,0,-3), _V(0,-1,0), THRUST, ph_main, ISP);
th_rcs[ 6] = CreateThruster (_V(-2.25,0,-3), _V(0, 1,0), THRUST, ph_main, ISP);
th_rcs[ 7] = CreateThruster (_V(-2.25,0,-3), _V(0,-1,0), THRUST, ph_main, ISP);
th_rcs[ 8] = CreateThruster (_V( 2.25,0, 3), _V(-1,0,0), THRUST, ph_main, ISP);
th_rcs[ 9] = CreateThruster (_V(-2.25,0, 3), _V( 1,0,0), THRUST, ph_main, ISP);
th_rcs[10] = CreateThruster (_V( 2.25,0,-3), _V(-1,0,0), THRUST, ph_main, ISP);
th_rcs[11] = CreateThruster (_V(-2.25,0,-3), _V( 1,0,0), THRUST, ph_main, ISP);*/
}
void _SSM::clbkSaveState (FILEHANDLE scn)
{
VESSEL2::clbkSaveState (scn);
}
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
return new _SSM (hvessel, flightmodel);
}
DLLCLBK void ovcExit (VESSEL *vessel)
{
if (vessel) delete (_SSM*)vessel;
}
DLLCLBK void ExitModule (HINSTANCE hModule)
{
// perform module cleanup here
}
}
Code:
1>------ Build started: Project: SSM, Configuration: Debug Win32 ------
1>Compiling...
1>SSM.cpp
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(96) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(53) : System::IServiceProvider IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(96) : error C3699: '*' : cannot use this indirection on type 'IServiceProvider'
1> compiler replacing '*' with '^' to continue parsing
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : error C2371: 'IServiceProvider' : redefinition; different basic types
1> c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(53) : see declaration of 'IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(120) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(235) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(242) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\urlmon.h(5854) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\urlmon.h(5856) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>.\SSM.cpp(74) : error C2059: syntax error : 'string'
1>.\SSM.cpp(75) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>.\SSM.cpp(79) : error C2059: syntax error : 'string'
1>.\SSM.cpp(80) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>.\SSM.cpp(84) : error C2059: syntax error : 'string'
1>.\SSM.cpp(85) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>.\SSM.cpp(89) : fatal error C1004: unexpected end-of-file found
1>Build log was saved at "file://c:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\SSM\Debug\BuildLog.htm"
1>SSM - 15 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========