> Wouldn't something like this work?
>
> Either:
>
> using namespace jsbsim
>
> or
>
> using jsbsim::FGFDMExec
> etc...
>
> at the top of the files
>
> or
>
> fdmex = new jsbsim::FGFDMExec
> etc...
>
> everytime its needed.
>
> Cheers - Dave


You would expect it to, wouldn't you. I added "using namespace JSBSim" at
the top of JSBSim.hxx as follows:

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%*/

#include <simgear/misc/props.hxx>

#include <FDM/JSBSim/FGFDMExec.h>

using namespace JSBSim;

class FGState;
class FGAtmosphere;
class FGFCS;
class FGPropulsion;
class FGMassBalance;
class FGAerodynamics;
class FGInertial;
class FGAircraft;
class FGTranslation;
class FGRotation;
class FGPosition;
class FGAuxiliary;
class FGOutput;
class FGInitialCondition;

But, I get this when I try and compile:

g++ -DHAVE_CONFIG_H -I. -I. -I../../../src/Include -I../../.. -I../../../s
rc   -DFGFS  -c -o JSBSim.o `test -f 'JSBSim.cxx' || echo './'`JSBSim.cxx
In file included from JSBSim.cxx:63:
JSBSim.hxx:218: syntax error before `*'
JSBSim.hxx:221: syntax error before `*'
JSBSim.hxx:222: syntax error before `*'
JSBSim.hxx:223: syntax error before `*'
JSBSim.hxx:224: syntax error before `*'
JSBSim.hxx:225: syntax error before `*'
JSBSim.hxx:226: syntax error before `*'
JSBSim.hxx:227: syntax error before `*'
JSBSim.hxx:228: syntax error before `*'
JSBSim.hxx:229: syntax error before `*'
JSBSim.hxx:230: syntax error before `*'
JSBSim.hxx:231: syntax error before `*'
JSBSim.cxx: In method `FGJSBsim::FGJSBsim(double)':
JSBSim.cxx:81: parse error before `='
JSBSim.cxx:82: `Atmosphere' undeclared (first use this function)
JSBSim.cxx:82: (Each undeclared identifier is reported only once
JSBSim.cxx:82: for each function it appears in.)
JSBSim.cxx:83: `FCS' undeclared (first use this function)
JSBSim.cxx:84: `MassBalance' undeclared (first use this function)
...
...

The pertinent lines in JSBSim.cxx are:

== Line 63, JSBSim.cxx:

#include "JSBSim.hxx"

== Line 218, JSBSim.hxx:

private:
    FGFDMExec *fdmex;
    FGInitialCondition *fgic; // <-- line 218
    bool needTrim;

    FGState*        State;
    FGAtmosphere*   Atmosphere;
    FGFCS*          FCS;

== Line 81, JSBSim.cxx:

FGJSBsim::FGJSBsim( double dt )
  : FGInterface(dt)
{
    bool result;

    fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );

    State           = fdmex->GetState(); // <-- Line 81
    Atmosphere      = fdmex->GetAtmosphere();
    FCS             = fdmex->GetFCS();
    MassBalance     = fdmex->GetMassBalance();

So, any suggestions? I'm stuck.

Jon

Attachment: smime.p7s
Description: application/pkcs7-signature

Reply via email to