Lars Gullik Bjønnes wrote: > PreviewLoader.C:594: instantiated from here > /opt/gcc34/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_list.h:84: > error: `__gnu_norm::_List_node<_Tp>::_M_data' has incomplete type > ../../src/ParagraphList_fwd.h:18: error: forward declaration of > `struct Paragraph'
Thanks, Lars. The code it doesn't like: 593 // Loop over the insets in the buffer and dump all the math-macros. 594 Buffer::inset_iterator it = buffer_.inset_const_iterator_begin(); 595 Buffer::inset_iterator end = buffer_.inset_const_iterator_end(); 597 for (; it != end; ++it) 598 if (it->lyxCode() == InsetOld::MATHMACRO_CODE) 599 it->latex(buffer_, os, runparams); In turn, buffer.h has this: #include "ParagraphList_fwd.h" class Buffer { public: class inset_iterator { private: ParagraphList::iterator pit; ParagraphList::iterator pend; }; }; So, my question becomes: do you need to know 'paragraph' to instantiate std::list<paragraph>::iterator? I guess the answer to that is 'yes' (or the compiler would not be complaining). That being the case, then I also guess that the CORRECT place to #include "paragraph" (and I hate to say this) is buffer.h itself. Thoughts? Why do non-g++3.4 compilers seem quite happy with this though? -- Angus