Boost logo

Boost :

Subject: Re: [boost] [statechart] Undefined type
From: s_a_white_at_[hidden]
Date: 2010-03-13 11:25:41


Hi Andreas,

The following is a rough guide to the layout of the code that currently builds under Linux (reactions are not shown). I hope it shows enough details to answer your questions:

M.h:

struct A1;
struct A2;
struct A3;
struct B0;
struct C0;

struct M: sc::state_machine< M, A1 >
{
void start ();
...
};

struct A1 : sc::simple_state< A1, M >
{
A1();
~A1();
};
 A1 : sc::simple_state< A1, M >
{
A1();
~A1();
};

struct A2 : sc::simple_state< A2, M >
{
A2();
~A2();
};
 A2 : sc::simple_state< A2, M >
{
A2();
~A2();
};

struct A3 : sc::simple_state< A3, M, mpl::list<B0, C0> >
{
A3();
~A3();
};
 A3 : sc::simple_state< A3, M, mpl::list<B0, C0> >
{
A3();
~A3();
};

B.h:

#include "M.h"
struct B1;
struct B2;
struct B3;
struct D1;

struct B0 : sc::state< B0, A3::orthogonal< 0 >, B1>
{
B0(my_context ctx);
~B0();
};
 B0 : sc::state< B0, A3::orthogonal< 0 >, B1>
{
B0(my_context ctx);
~B0();
};

struct B1 : sc::state< B1, B0>
 B1 : sc::state< B1, B0>
{
B1(my_context ctx);
~B1();
};

struct B2 : sc::state< B2, B0, D1>
 B2 : sc::state< B2, B0, D1>
{
B2(my_context ctx);
~B2();
};

struct B3 : sc::state< B3, B0>
 B3 : sc::state< B3, B0>
{
B3(my_context ctx);
~B3();
};

C.h:

#include "M.h"
struct C1;
struct C2;

struct C0 : sc::state< C0, A3::orthogonal< 1 >, C1>
{
C0(my_context ctx);
~C0();
};
 C0 : sc::state< C0, A3::orthogonal< 1 >, C1>
{
C0(my_context ctx);
~C0();
};

struct C1 : sc::state< C1, C0>
 C1 : sc::state< C1, C0>
{
C1(my_context ctx);
~C1();
};

struct C2 : sc::state< C2, C0>
 C2 : sc::state< C2, C0>
{
C2(my_context ctx);
~C2();
};

D.h:

#include "B.h"

struct D2;
struct D1 : sc::state< D1, B2>
 D1 : sc::state< D1, B2>
{
D1(my_context ctx);
~D1();
};

struct D2 : sc::state< D2, B2>
 D2 : sc::state< D2, B2>
{
D2(my_context ctx);
~D2();
};
 
M.cpp:

#include "M.h"
#include "B.h"
#include "C.h"

void M::start () { initiate (); }
<any other M class related stuff>

A.cpp

#include "M.h"
#include "B.h"
#include "C.h"
<all A class related stuff>

B.cpp

#include "B.h"
#include "D.h"
<all B class related stuff>

C.cpp

#include "C.h"
<all C class related stuff>

D.cpp

#include "D.h"
<all D class related stuff>

main.cpp:

#include "M.h"
int main ()
{
M m;
m.start ();
return 0;
}

thirdparty.cpp:

#include "M.h"
M *m = 0;
 
Under Windows the following errors are produced:
thirdparty.cpp, main.cpp, C.cpp:
c:\PXI Code Base\CommonPlatform\include\boost\statechart\simple_state.hpp(893) : error C2027: use of undefined type 'B0'
A.cpp, M.cpp:
c:\PXI Code Base\CommonPlatform\include\boost\statechart\simple_state.hpp(893) : error C2027: use of undefined type 'D1'
B.cpp:
c:\PXI Code Base\CommonPlatform\include\boost\statechart\simple_state.hpp(893) : error C2027: use of undefined type 'C0'

Simon


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk