Sign in to follow this  

Cat Mother Build Errors

This topic is 3726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, Upon building the Cat Mother engine I'm receiving masses of errors. So there's clearly something fundamentally wrong my end. The first major issue seems to be caused by a template class not being recognised, caused various syntax errors of type... 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(60) : error C2146: syntax error : missing ';' before identifier 'value' 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(60) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(60) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(60) : warning C4183: 'value': missing return type; assumed to be a member function returning 'int' 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(84) : error C2146: syntax error : missing ';' before identifier 'm_sign' 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(85) : error C2146: syntax error : missing ';' before identifier 'm_value' 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(86) : error C2146: syntax error : missing ';' before identifier 'm_fractionScale' 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(87) : error C2146: syntax error : missing ';' before identifier 'm_expSign' 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(87) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(87) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\lee\documents\visual studio 2005\projects\playtime\lang\numberreader.h(88) : error C2146: syntax error : missing ';' before identifier 'm_expValue' ...it's a long list. The numberreader header file goes like so (there must be a way to format code on these boards?)... #ifndef _LANG_NUMBERREADER_H #define _LANG_NUMBERREADER_H namespace lang { /** * Finite automaton for extracting numeric value from character sequence * one character at a time. * * Only English/US locale is supported. This class * is not really suitable for reading user input but * for example parsing text data. * * Usage example:
	NumberReader(float) floatReader;

	const char* str = "123.123";
	for ( ; floatReader.put(*str) ; ++str );
	float value = floatReader.value();
	
	assert( value == 123.123f );
	
* * @author Jani Kajala (jani.kajala@helsinki.fi) */ template <class T> class NumberReader { public: /// NumberReader(); /** * Appends a character to string representation to be converted to numeric value. * If character is not accepted then the reader is reset to initial state. * * @return Number of characters accepted (either 0 or 1). */ int put( char ch ); /// Returns current input converted to numeric value. const T& value() const; /// Returns true if the input describes valid numeric value. bool valid() const; }; // NumberReader specialization for double. template <> class NumberReader<double> { public: NumberReader() {m_state=STATE_INIT; m_valid=false;} int put( char ch ); T value() const; bool valid() const {return m_valid;} private: enum State { // initial state STATE_INIT, // [\+|\-]_STATE_BODY STATE_SIGN, // {._STATE_FRACTION|<d>+[._STATE_FRACTION]}[e_STATE_EXP|E_STATE_EXP] STATE_BODY, // {<d>*}[e_STATE_EXP|E_STATE_EXP] STATE_FRACTION, // [\+|\-]_STATE_EXP_BODY STATE_EXP, // {.STATE_EXP_FRACTION|<d>+[.STATE_EXP_FRACTION]} STATE_EXP_BODY, // <d>* STATE_EXP_FRACTION, }; bool m_valid; State m_state; T m_sign; T m_value; T m_fractionScale; T m_expSign; T m_expValue; }; // NumberReader specialization for float. template <> class NumberReader<float> { public: NumberReader() {} int put( char ch ) {return m_impl.put(ch);} T value() const {return (T)m_impl.value();} bool valid() const {return m_impl.valid();} private: NumberReader<double> m_impl; }; // NumberReader specialization for long. template <> class NumberReader<long> { public: NumberReader() {m_state=STATE_INIT; m_valid=false;} int put( char ch ); T value() const; bool valid() const {return m_valid;} private: enum State { // initial state STATE_INIT, // [\+|\-]_STATE_BODY STATE_SIGN, // <d>+ STATE_BODY, }; bool m_valid; State m_state; T m_sign; T m_value; }; // NumberReader specialization for int. template <> class NumberReader<int> { public: NumberReader() {} int put( char ch ) {return m_impl.put(ch);} T value() const {return (T)m_impl.value();} bool valid() const {return m_impl.valid();} private: NumberReader<long> m_impl; }; // NumberReader specialization for short. template <> class NumberReader<short> { public: NumberReader() {} int put( char ch ) {return m_impl.put(ch);} T value() const {return (T)m_impl.value();} bool valid() const {return m_impl.valid();} private: NumberReader<long> m_impl; }; // NumberReader specialization for unsigned long. template <> class NumberReader<unsigned long> { public: NumberReader() {m_state=STATE_INIT; m_valid=false;} int put( char ch ); T value() const; bool valid() const {return m_valid;} private: enum State { // initial state STATE_INIT, // <d>+ STATE_BODY, }; bool m_valid; State m_state; T m_value; }; // NumberReader specialization for unsigned int. template <> class NumberReader<unsigned> { public: NumberReader() {} int put( char ch ) {return m_impl.put(ch);} T value() const {return (T)m_impl.value();} bool valid() const {return m_impl.valid();} private: NumberReader<unsigned long> m_impl; }; // NumberReader specialization for unsigned short. template <> class NumberReader<unsigned short> { public: NumberReader() {} int put( char ch ) {return m_impl.put(ch);} T value() const {return (T)m_impl.value();} bool valid() const {return m_impl.valid();} private: NumberReader<unsigned long> m_impl; }; } // lang #endif // _LANG_NUMBERREADER_H Does some one know what's happening to cause all the errors? And has anyone had joy in getting dead justic to compile? Many thanks in advance. (Any hints on formatting the code would be appreciated too.)

Share this post


Link to post
Share on other sites

This topic is 3726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this