Boost logo

Boost :

From: Dan W. (danw_at_[hidden])
Date: 2003-11-30 15:53:20


Hi, I'm using latest betas for Digital Mars, STLport and BOOST, and I'm
trying to compile a state-machine using boost's fsm::state_machine.
My include line is as follows:
   G:\boost-1.30.2;G:\boost-1.30.2\boost\mpl;G:\boost-1.30.2\libs\mpl\example\fsm;G:\dm\STLport-5.0-1031\stlport;G:\dm\include
Here's the top of my file:

  ...............................................................................
#include <iostream>
#include "boost/mpl/list.hpp"
#include "state_machine.hpp"

namespace mpl = boost::mpl;

class rec_frm_sm : fsm::state_machine<rec_frm_sm>
{
  public:
  ...............................................................................

What I get on the output window is:

sc rec_frm.cpp -Ae -Aa -r -mn -C -WA -S -3 -a8 -c -gf -IG:\boost-1.30.2
-IG:\boost-1.30.2\boost\mpl -IG:\boost-1.30.2\libs\mpl\example\fsm
-IG:\dm\STLport-5.0-1031\stlport -IG:\dm\include -orec_frm.obj
Error: G:\boost-1.30.2\boost/mpl/aux_/preprocessed/plain /quote.hpp(7): no
type for argument 'T'
Error: G:\boost-1.30.2\boost/mpl/aux_/has_type.hpp(23): no type for
argument 'T'
Error: G:\boost-1.30.2\libs\mpl\example\fsm\state_machine.hpp(67): ';'
expected following declaration of struct member
Error: G:\boost-1.30.2\libs\mpl\example\fsm\state_machine.hpp(73): '{' expected
Fatal Error: G:\boost-1.30.2\libs\mpl\example\fsm\state_machine.hpp(78):
too many errors
Lines Processed: 34008 Errors: 5 Warnings: 0
Build failed

I'm not sure how to track the include path for quote.hpp and has_type.hpp.
I notice there's a link at www.boost.org for tracking header file
inclusion, but the link appears to be broken.
The other errors happen in the state_machine.hpp file from boost, which I
modified to add a visitor hook, as follows:

     ..................................................................................
     state_t current_state() const
     {
         return m_state;
     }
     // ******************** added by DW *********************** \\
     struct avisitor
     { // <-------------(1)
         template < state_t S >
         virtual void visit( S s ) const
         {
             assert( false );
         }
         template < state_t S, class C > // <-------------(2)
         virtual void visit( S s, C const & c ) const
         {
             assert( false );
         }
     };
     template < avisitor V >
     void accept( V const & v ) const
     {
         v.visit(m_state);
     }
     template < avisitor V >
     void accept( V const & v )
     {
         v.visit(m_state);
     }
     template < avisitor V, class C >
     void accept( V const & v, C const & c ) const
     {
         v.visit(m_state,c);
     }
     template < avisitor V, class C >
     void accept( V const & v, C const & c )
     {
         v.visit(m_state,c);
     }
     //********************************************************\\
  protected:
     // interface for the derived class
     state_machine(state_t const& initial_state)
         : m_state(initial_state)
     {}
     ..........................................................................

The missing semicolon is reported at the opening brace of struct avisitor (1).
The '{' expected happens at the line of the second template declaration (2).

Any help would be appreciated.
Yours.
dan


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