C++ Question Weird errors at compile time, no obvious solution.

Zatnikitelman

Addon Developer
Addon Developer
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.

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 ==========
 
E

ex-orbinaut

Guest
I am reasonably new to this myself, but there is one thing that seems plainly obvious with a glance at your code.

You have #included a specific h file for your vessel, yet you still define the vessel class in the cpp. Had a similar experience; never got it to work. If you have the h file, define the vessel class and declare your functions there. That works. Otherwise, don't have the h file at all (that's applicable for the way you seem to be doing it). The vessel does not look complicated enough to merit one.

I wouldn't /* comment out * / arguments that are required in a callback function. Use them or ignore them, as you need (I am referring to void _SSM::clbkLoadStateEx (FILEHANDLE scn/*, void *status*/). Look at the API reference for info on what arguments are required for each API function.

Not too sure that setting your general vessel constants in a callback is exactly right. Not tried it. However, do that in the h file aswell, if you have one, or outside of functions in the cpp, if you dont. That also works.

Hope it helps point you in the right direction. Look at the ShuttleA sample in the orbitersdk\samples as an intermediate example to base your vessel on (with h file), or ShuttlePB without h file.

Somebody better than I could help you with the finer points.
 

Wraith

New member
Joined
Oct 7, 2008
Messages
59
Reaction score
0
Points
0
Location
Moscow
First is the .cpp file, second is a readout of all the errors.
Code:
...
#include "SSM.h"
Check that ssm.h file. Could be you simply have unbalanced '{}' or forgot a ';' after some class definition or a function prototype.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
Ok, I cleaned up a little, commented out the preprocessor include "SSM.h" so now all I'm getting is the syntax, unexpected token, and unexpected end of file errors. The only reason I'm commenting out the arguments is because I think those arguments are only used during an overload which would only be when I'm declaring my own stuff instead of just going with Orbiter default. Nothing's changed in my code except commenting out the include "ssm.h"

I'm also curious about something else because I had to rename my class as _SSM because it kept tossing an error along the lines of: "SSM already defined as namespace" and going with _SSM as my class did the trick.
Again, thanks for any and all help,
Zat
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Ok, I cleaned up a little, commented out the preprocessor include "SSM.h" so now all I'm getting is the syntax, unexpected token, and unexpected end of file errors. The only reason I'm commenting out the arguments is because I think those arguments are only used during an overload which would only be when I'm declaring my own stuff instead of just going with Orbiter default. Nothing's changed in my code except commenting out the include "ssm.h"
Are you actually using anything in stdafx.h? If not get rid of it. Either way, check you have precompiled headers turned off - I have had trouble with them in the past and the compile time for Orbiter modules is not really all that long.
 

MeDiCS

Donator
Donator
Joined
Sep 22, 2008
Messages
602
Reaction score
2
Points
0
I'm pretty sure you have to declare ORBITER_MODULE before including orbitersdk.h, since the preprocessor directives are processed in only one pass.
Remove stdafx.h and turn this feature off (project properties).
You don't need to implement the destructor if you're not using it.
Commenting out code is asking for trouble. It gets too cluttered and hard to read.
It seems you're prototyping the methods and implementing them inside the class. I don't know if this is a problem, but try to implement them outside the class if you have them prototyped. Also, prototyping in C++ is not a requirement like is in C, so no need for header files.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
I've killed off stdafx.h, defined ORBITER_MODULE before including orbitersdk.h, but I'm still getting weird errors:
Code:
// This is the main DLL file.

#include "stdafx.h"
//#include "SSM.h"
#define ORBITER_MODULE
#include "orbitersdk.h"



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);
        void clbkLoadStateEx (FILEHANDLE scn, void *status);
        //void clbkSet
    }
    ~_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>.\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) : error C2059: syntax error : 'string'
1>.\SSM.cpp(90) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>.\SSM.cpp(93) : fatal error C1075: end of file found before the left brace '{' at '.\SSM.cpp(18)' was matched
1>Build log was saved at "file://c:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\SSM\Debug\BuildLog.htm"
1>SSM - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

MeDiCS

Donator
Donator
Joined
Sep 22, 2008
Messages
602
Reaction score
2
Points
0
Seems you have a missing ';' or '}'. Also, #include <string>.
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
The class definition is not closed out after _SSM::clbkSaveState. Add an extra '}' after that function.
 

SiameseCat

Addon Developer
Addon Developer
Joined
Feb 9, 2008
Messages
1,699
Reaction score
1
Points
0
Location
Ontario
It looks to me like you're declaring member functions within the constructor.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
Yep, that's what was happening, I moved the declarations outside of the constructor and into the class and those errors went away.
But now I have 79 others all related to linking. I hate to post my entire code again and errors again, but I'm not finding any easy solution.
Code:
// This is the main DLL file.

#include "stdafx.h"
#define ORBITER_MODULE
#include "orbitersdk.h"

HINSTANCE g_hDLL;

DLLCLBK void InitModule(HINSTANCE hModule)
{
    g_hDLL = hModule;
}

class S_S_M: public VESSEL2 
{
    public:
    S_S_M (OBJHANDLE hObj, int fmodel): VESSEL2 (hObj, fmodel) 
    {    
    }
        PROPELLANT_HANDLE ph_main;
        THRUSTER_HANDLE th_rcs[12];

        void clbkLoadStateEx (FILEHANDLE scn, void *status);
        void clbkSaveState (FILEHANDLE scn);
        void clbkSetClassCaps (FILEHANDLE cfg);
    ~S_S_M () 
    {
    }
};
void S_S_M::clbkLoadStateEx (FILEHANDLE scn, void *status)
{
    char *line;

    while (oapiReadScenario_nextline (scn, line)) 
    {
        ParseScenarioLineEx (line, status);
    }
}

void S_S_M::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 S_S_M::clbkSaveState (FILEHANDLE scn)
{
    VESSEL2::clbkSaveState (scn);
}

DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
    return new S_S_M (hvessel, flightmodel);
}

DLLCLBK void ovcExit (VESSEL *vessel)
{
    if (vessel) delete (S_S_M*)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>Linking...
1>   Creating library C:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\Debug\SSM.lib and object C:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\Debug\SSM.exp
1>SSM.obj : error LNK2028: unresolved token (0A0003A7) "public: virtual void __thiscall VESSEL2::clbkSaveState(void *)" (?clbkSaveState@VESSEL2@@$$FUAEXPAX@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSaveState(void *)" (?clbkSaveState@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003A8) "public: void * __thiscall VESSEL::CreatePropellantResource(double,double,double)const " (?CreatePropellantResource@VESSEL@@$$FQBEPAXNNN@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003A9) "void * __cdecl oapiLoadMeshGlobal(char const *)" (?oapiLoadMeshGlobal@@$$FYAQAXPBD@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003AA) "public: unsigned int __thiscall VESSEL::AddMesh(void *,union VECTOR3 const *)const " (?AddMesh@VESSEL@@$$FQBEIPAXPBTVECTOR3@@@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003AB) "public: void __thiscall VESSEL::SetSize(double)const " (?SetSize@VESSEL@@$$FQBEXN@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003AC) "public: void __thiscall VESSEL::SetEmptyMass(double)const " (?SetEmptyMass@VESSEL@@$$FQBEXN@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003AD) "public: void __thiscall VESSEL::ParseScenarioLineEx(char *,void *)const " (?ParseScenarioLineEx@VESSEL@@$$FQBEXPADPAX@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkLoadStateEx(void *,void *)" (?clbkLoadStateEx@S_S_M@@$$FUAEXPAX0@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003AE) "bool __cdecl oapiReadScenario_nextline(void *,char * &)" (?oapiReadScenario_nextline@@$$FYA_NPAXAAPAD@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkLoadStateEx(void *,void *)" (?clbkLoadStateEx@S_S_M@@$$FUAEXPAX0@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003AF) "public: __thiscall VESSEL2::VESSEL2(void *,int)" (??0VESSEL2@@$$FQAE@PAXH@Z) referenced in function "public: __thiscall S_S_M::S_S_M(void *,int)" (??0S_S_M@@$$FQAE@PAXH@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003B0) "public: virtual __thiscall ExternMFD::~ExternMFD(void)" (??1ExternMFD@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall ExternMFD::`scalar deleting destructor'(unsigned int)" (??_GExternMFD@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003B1) "public: virtual __thiscall GraphMFD::~GraphMFD(void)" (??1GraphMFD@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall GraphMFD::`scalar deleting destructor'(unsigned int)" (??_GGraphMFD@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003B2) "public: virtual __thiscall MFD::~MFD(void)" (??1MFD@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall MFD::`scalar deleting destructor'(unsigned int)" (??_GMFD@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2028: unresolved token (0A0003B3) "void __cdecl dummy(void)" (?dummy@@$$FYAXXZ) referenced in function "void __cdecl calldummy(void)" (?calldummy@@$$FYAXXZ)
1>SSM.obj : error LNK2028: unresolved token (0A0003B4) "public: virtual __thiscall LaunchpadItem::~LaunchpadItem(void)" (??1LaunchpadItem@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall LaunchpadItem::`scalar deleting destructor'(unsigned int)" (??_GLaunchpadItem@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual char * __thiscall LaunchpadItem::Name(void)" (?Name@LaunchpadItem@@UAEPADXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual char * __thiscall LaunchpadItem::Description(void)" (?Description@LaunchpadItem@@UAEPADXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall LaunchpadItem::OpenDialog(struct HINSTANCE__ *,struct HWND__ *,int,int (__stdcall*)(struct HWND__ *,unsigned int,unsigned int,long))" (?OpenDialog@LaunchpadItem@@UAE_NPAUHINSTANCE__@@PAUHWND__@@HP6GH1IIJ@Z@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall LaunchpadItem::clbkOpen(struct HWND__ *)" (?clbkOpen@LaunchpadItem@@UAE_NPAUHWND__@@@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall LaunchpadItem::clbkWriteConfig(void)" (?clbkWriteConfig@LaunchpadItem@@UAEHXZ)
1>SSM.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall LaunchpadItem::~LaunchpadItem(void)" (??1LaunchpadItem@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall LaunchpadItem::`scalar deleting destructor'(unsigned int)" (??_GLaunchpadItem@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Cockpit::Store(char *)" (?Store@CameraMode_Cockpit@@UAEXPAD@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Cockpit::GetDescr(char *,int)" (?GetDescr@CameraMode_Cockpit@@UAEXPADH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Track::Init(char *)" (?Init@CameraMode_Track@@UAEXPAD@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Track::Store(char *)" (?Store@CameraMode_Track@@UAEXPAD@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Track::GetDescr(char *,int)" (?GetDescr@CameraMode_Track@@UAEXPADH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Ground::Init(char *)" (?Init@CameraMode_Ground@@UAEXPAD@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Ground::Store(char *)" (?Store@CameraMode_Ground@@UAEXPAD@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CameraMode_Ground::GetDescr(char *,int)" (?GetDescr@CameraMode_Ground@@UAEXPADH@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "void __cdecl dummy(void)" (?dummy@@$$FYAXXZ) referenced in function "void __cdecl calldummy(void)" (?calldummy@@$$FYAXXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CELBODY::bEphemeris(void)const " (?bEphemeris@CELBODY@@UBE_NXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CELBODY::clbkInit(void *)" (?clbkInit@CELBODY@@UAEXPAX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CELBODY::clbkEphemeris(double,int,double *)" (?clbkEphemeris@CELBODY@@UAEHNHPAN@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CELBODY::clbkFastEphemeris(double,int,double *)" (?clbkFastEphemeris@CELBODY@@UAEHNHPAN@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CELBODY::clbkAtmParam(double,struct ATMPARAM *)" (?clbkAtmParam@CELBODY@@UAE_NNPAUATMPARAM@@@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkSetClassCaps(void *)" (?clbkSetClassCaps@VESSEL2@@UAEXPAX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkSaveState(void *)" (?clbkSaveState@VESSEL2@@UAEXPAX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkLoadStateEx(void *,void *)" (?clbkLoadStateEx@VESSEL2@@UAEXPAX0@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkSetStateEx(void const *)" (?clbkSetStateEx@VESSEL2@@UAEXPBX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkPostCreation(void)" (?clbkPostCreation@VESSEL2@@UAEXXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkFocusChanged(bool,void *,void *)" (?clbkFocusChanged@VESSEL2@@UAEX_NPAX1@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkPreStep(double,double,double)" (?clbkPreStep@VESSEL2@@UAEXNNN@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkPostStep(double,double,double)" (?clbkPostStep@VESSEL2@@UAEXNNN@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkPlaybackEvent(double,double,char const *,char const *)" (?clbkPlaybackEvent@VESSEL2@@UAE_NNNPBD0@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkVisualCreated(void *,int)" (?clbkVisualCreated@VESSEL2@@UAEXPAXH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkVisualDestroyed(void *,int)" (?clbkVisualDestroyed@VESSEL2@@UAEXPAXH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkDrawHUD(int,struct HUDPAINTSPEC const *,struct HDC__ *)" (?clbkDrawHUD@VESSEL2@@UAEXHPBUHUDPAINTSPEC@@PAUHDC__@@@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkRCSMode(int)" (?clbkRCSMode@VESSEL2@@UAEXH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkADCtrlMode(unsigned long)" (?clbkADCtrlMode@VESSEL2@@UAEXK@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkHUDMode(int)" (?clbkHUDMode@VESSEL2@@UAEXH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkMFDMode(int,int)" (?clbkMFDMode@VESSEL2@@UAEXHH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkNavMode(int,bool)" (?clbkNavMode@VESSEL2@@UAEXH_N@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkDockEvent(int,void *)" (?clbkDockEvent@VESSEL2@@UAEXHPAX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkAnimate(double)" (?clbkAnimate@VESSEL2@@UAEXN@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall VESSEL2::clbkConsumeDirectKey(char *)" (?clbkConsumeDirectKey@VESSEL2@@UAEHPAD@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall VESSEL2::clbkConsumeBufferedKey(unsigned long,bool,char *)" (?clbkConsumeBufferedKey@VESSEL2@@UAEHK_NPAD@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkLoadGenericCockpit(void)" (?clbkLoadGenericCockpit@VESSEL2@@UAE_NXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkLoadPanel(int)" (?clbkLoadPanel@VESSEL2@@UAE_NH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkPanelMouseEvent(int,int,int,int)" (?clbkPanelMouseEvent@VESSEL2@@UAE_NHHHH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkPanelRedrawEvent(int,int,void *)" (?clbkPanelRedrawEvent@VESSEL2@@UAE_NHHPAX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkLoadVC(int)" (?clbkLoadVC@VESSEL2@@UAE_NH@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkVCMouseEvent(int,int,union VECTOR3 &)" (?clbkVCMouseEvent@VESSEL2@@UAE_NHHAATVECTOR3@@@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkVCRedrawEvent(int,int,void *)" (?clbkVCRedrawEvent@VESSEL2@@UAE_NHHPAX@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall MFD::~MFD(void)" (??1MFD@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall MFD::`scalar deleting destructor'(unsigned int)" (??_GMFD@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall GraphMFD::~GraphMFD(void)" (??1GraphMFD@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall GraphMFD::`scalar deleting destructor'(unsigned int)" (??_GGraphMFD@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ExternMFD::SetVessel(void *)" (?SetVessel@ExternMFD@@UAEXPAX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ExternMFD::clbkUpdate(void)" (?clbkUpdate@ExternMFD@@UAEXXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ExternMFD::clbkRefreshDisplay(void *)" (?clbkRefreshDisplay@ExternMFD@@UAEXPAX@Z)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ExternMFD::clbkRefreshButtons(void)" (?clbkRefreshButtons@ExternMFD@@UAEXXZ)
1>SSM.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ExternMFD::clbkFocusChanged(void *)" (?clbkFocusChanged@ExternMFD@@UAEXPAX@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall ExternMFD::~ExternMFD(void)" (??1ExternMFD@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall ExternMFD::`scalar deleting destructor'(unsigned int)" (??_GExternMFD@@$$FUAEPAXI@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: __thiscall VESSEL2::VESSEL2(void *,int)" (??0VESSEL2@@$$FQAE@PAXH@Z) referenced in function "public: __thiscall S_S_M::S_S_M(void *,int)" (??0S_S_M@@$$FQAE@PAXH@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: void __thiscall VESSEL::ParseScenarioLineEx(char *,void *)const " (?ParseScenarioLineEx@VESSEL@@$$FQBEXPADPAX@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkLoadStateEx(void *,void *)" (?clbkLoadStateEx@S_S_M@@$$FUAEXPAX0@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "bool __cdecl oapiReadScenario_nextline(void *,char * &)" (?oapiReadScenario_nextline@@$$FYA_NPAXAAPAD@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkLoadStateEx(void *,void *)" (?clbkLoadStateEx@S_S_M@@$$FUAEXPAX0@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: void * __thiscall VESSEL::CreatePropellantResource(double,double,double)const " (?CreatePropellantResource@VESSEL@@$$FQBEPAXNNN@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall VESSEL::AddMesh(void *,union VECTOR3 const *)const " (?AddMesh@VESSEL@@$$FQBEIPAXPBTVECTOR3@@@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "void * __cdecl oapiLoadMeshGlobal(char const *)" (?oapiLoadMeshGlobal@@$$FYAQAXPBD@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: void __thiscall VESSEL::SetSize(double)const " (?SetSize@VESSEL@@$$FQBEXN@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: void __thiscall VESSEL::SetEmptyMass(double)const " (?SetEmptyMass@VESSEL@@$$FQBEXN@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSetClassCaps(void *)" (?clbkSetClassCaps@S_S_M@@$$FUAEXPAX@Z)
1>SSM.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkSaveState(void *)" (?clbkSaveState@VESSEL2@@$$FUAEXPAX@Z) referenced in function "public: virtual void __thiscall S_S_M::clbkSaveState(void *)" (?clbkSaveState@S_S_M@@$$FUAEXPAX@Z)
1>C:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\Debug\SSM.dll : fatal error LNK1120: 79 unresolved externals
1>Build log was saved at "file://c:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\SSM\Debug\BuildLog.htm"
1>SSM - 80 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
It looks like orbiter.lib and/or Orbitersdk.lib are not being linked in. Check your "Additional Library Directories" and "Additional Dependencies".
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
Ok, that sort of worked, got rid of those 79 errors, but now it appears that something is being defined twice and the compiler doesn't like it.
Same code, but new [shorter] error log.
I tried ignoring the MSVCRT.lib, but that gave me more errors.
Code:
1>------ Build started: Project: SSM, Configuration: Debug Win32 ------
1>Linking...
1>   Creating library C:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\Debug\SSM.lib and object C:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\Debug\SSM.exp
1>orbitersdk.lib(Orbitersdk.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)
1>C:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\Debug\SSM.dll : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://c:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\SSM\Debug\BuildLog.htm"
1>SSM - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks for all help!
Zat

---------- Post added at 04:59 PM ---------- Previous post was Yesterday at 05:44 PM ----------

YAY! It compiled! Sort of. It compiles successfully when I have it set to debug, but when I set it to release mode, it fails and says:

Code:
1>------ Build started: Project: SSM, Configuration: Release Win32 ------
1>Compiling...
1>SSM.cpp
1>.\SSM.cpp(4) : fatal error C1083: Cannot open include file: 'orbitersdk.h': No such file or directory
1>Build log was saved at "file://c:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\SSM\Release\BuildLog.htm"
1>SSM - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Is there something I missed setting up the project?

BTW-the error from above was evidently caused by defining ORBITER_MODULE before including orbitersdk.h.
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
YAY! It compiled! Sort of. It compiles successfully when I have it set to debug, but when I set it to release mode, it fails and says:

Code:
1>------ Build started: Project: SSM, Configuration: Release Win32 ------
1>Compiling...
1>SSM.cpp
1>.\SSM.cpp(4) : fatal error C1083: Cannot open include file: 'orbitersdk.h': No such file or directory
1>Build log was saved at "file://c:\Orbiter\Orbiter06\Dev\SSM\Code\SSM\SSM\Release\BuildLog.htm"
1>SSM - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Is there something I missed setting up the project?

BTW-the error from above was evidently caused by defining ORBITER_MODULE before including orbitersdk.h.
You need to change the same settings in release that you had to change in debug. The settings are not automatically copied.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
YES! THANK YOU HIELOR!! I now got my first self-coded .dll vessel into the game! It's not much (as you can see from the code above) but that's what's great about saving code :p
THANKS EVERYONE!
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
YES! THANK YOU HIELOR!! I now got my first self-coded .dll vessel into the game! It's not much (as you can see from the code above) but that's what's great about saving code :p
THANKS EVERYONE!
:speakcool:

Just remember to only publish the "Release" version to other people, since the "Debug" version won't work on their computer unless they have VS installed.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
Ok, got another question, not as major and I can work around it but still...
Where can I define my variables? Right now I have the fuel, ISP, and thrust numbers defined and initialized under the setclasscaps method. I've tried moving them into my class, but I keep getting errors. I know in C++ there's only certain places where you can define variables particularly constants. I want the data to eb accessible by other methods possibly, but right now the data is limited by scope from what I understand.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
In order to make the variables visible to other methods, you can declare them in global scope. However the issue with this is that Orbiter loads only one instance of your dll module through a simulation session, which means that global data is shared through all the instances of your vessel. Define the global constants inside the header of your vessel class, before the class declaration. Define variables specific to your vessel inside the class itself.

public data is visible to the entire external environment as long as an object of your class is instantiated. static data can be used even without instantiation, and private data is only visible to methods of your class.
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
I think Zat wants variables to be visible to other member functions in his class (but not outside the class nor to other instances of the class). In that case, declare them in the private member section of your class declaration. Because you are not declaring the class in a header file, you will need to make sure the private section is above your public section and the variable declarations are above any private member functions.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Because you are not declaring the class in a header file, you will need to make sure the private section is above your public section and the variable declarations are above any private member functions.

Can you elaborate on that? I wasn't aware that there were restrictions as to where methods/fields are declared inside the class.
 
Top