NOMAD
Member
- Joined
- Aug 10, 2009
- Messages
- 111
- Reaction score
- 1
- Points
- 18
Hello,
I build a Rocket (no verniers and RCS)and try to compile it ,but there are 4 errors show in c++. I managed to find the problems but I failed.I don't know what's wrong with my code,so I post it here and hope someone can help me find the solution. Thanks!
Here is the code:
Error messages:
I translate it into English:
I build a Rocket (no verniers and RCS)and try to compile it ,but there are 4 errors show in c++. I managed to find the problems but I failed.I don't know what's wrong with my code,so I post it here and hope someone can help me find the solution. Thanks!
Here is the code:
Code:
#define ORBITER_MODULE
#define STRICT
#include "Orbitersdk.h"
//=============================================================
//Some Parameters of the Rocket
//=============================================================
const double MAX_MAIN_FUEL = 1.6e3;
const double MAX_MAIN_Thrust = 5.4e4;
const double VAC_MAIN_ISP = 5400;
const double NML_MAIN_ISP = 4500;
const double P_NML = 101.4e3;
//=============================================================
class Rocket: public VESSEL2 {
public:
Rocket (OBJHANDLE hObj, int fmodel): VESSEL2 (hObj, fmodel) {}
~Rocket () {}
PROPELLANT_HANDLE ph_main;
THRUSTER_HANDLE th_main;
void Rocket::clbkSetClassCaps (FILEHANDLE cfg)
{
SetSize (23.0);
SetEmptyMass (2000);
SetCrossSections (_V(179.19,12.02,179.06));
SetPMI (_V(632.84,1.74,632.85));
AddMesh ("test_rocket");
ph_main = CreatePropellantResource (MAX_MAIN_FUEL);
th_main = CreateThruster (_V(0,2.2,0), _V(0,3,0), MAX_MAIN_Thrust, ph_main ,VAC_MAIN_ISP, NML_MAIN_ISP, P_NML);
AddExhaust (th_main, 18, 3);
}
}
//=============================================================
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
return new Rocket (hvessel, flightmodel);
}
DLLCLBK void ovcExit (VESSEL *vessel)
{
if (vessel) delete (Rocket*)vessel;
}
Error messages:
Code:
1>------ 已启动生成: 项目: ROCKET, 配置: Release Win32 ------
1>正在编译...
1>ROCKET.cpp
1>.\ROCKET.cpp(34) : error C2143: 语法错误 : 缺少“;”(在“字符串”的前面)
1>.\ROCKET.cpp(34) : error C2059: 语法错误 : “字符串”
1>.\ROCKET.cpp(35) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)
1>.\ROCKET.cpp(35) : error C2447: “{”: 缺少函数标题(是否是老式的形式表?)
1>生成日志保存在“file://d:\My Documents\Visual Studio 2008\Projects\ROCKET\ROCKET\Release\BuildLog.htm”
1>ROCKET - 4 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
I translate it into English:
Code:
1 >------ Build started: Project: ROCKET, Configuration: Release Win32 ------
1> Compiling ...
1> ROCKET.cpp
1>. \ ROCKET.cpp (34): error C2143: syntax error: missing ";" (in the "string" in front)
1>. \ ROCKET.cpp (34): error C2059: syntax error: "string"
1>. \ ROCKET.cpp (35): error C2143: syntax error: missing ";" (in "{" in front)
1>. \ ROCKET.cpp (35): error C2447: "{": missing function header (whether in the form of old-fashioned table?)
1> Build log was saved at "file: / / d: \ My Documents \ Visual Studio 2008 \ Projects \ ROCKET \ ROCKET \ Release \ BuildLog.htm"
1> ROCKET - 4 errors, 0 warnings ======== == Build: 0 succeeded, 1 failed, the latest 0, 0 skipped ==========
Last edited: