Compiles fine, then doesn't...
-
Alright, I wrote a wrapper class for expat (the XML parser). I wrote it in a console application project, it compiles fine, and still does. But then I had to demo the technology that uses the wrapper class, and for that I went with an MFC application. But when I try to compile in my wrapper class, the expat .c files give me hundreds of errors. here's a chunk of it to look at: c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(91) : error C2143: syntax error : missing ')' before '*' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(91) : error C2143: syntax error : missing '{' before '*' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(91) : error C2059: syntax error : 'type' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(92) : error C2059: syntax error : ')' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(129) : error C2143: syntax error : missing ')' before '*' And here's some code so you can have a little context for the errors:
///////////// LINE 89 HERE //////////////////////////// static int PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr != end) { if (!CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { *nextTokPtr = ptr; return XML_TOK_INVALID; } ptr += MINBPC(enc); while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { INVALID_CASES(ptr, nextTokPtr) case BT_MINUS: if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_COMMENT; } break; default: ptr += MINBPC(enc); break; } } } return XML_TOK_PARTIAL; }
I'm pretty stumped. Anybody know what the problem is? -
Alright, I wrote a wrapper class for expat (the XML parser). I wrote it in a console application project, it compiles fine, and still does. But then I had to demo the technology that uses the wrapper class, and for that I went with an MFC application. But when I try to compile in my wrapper class, the expat .c files give me hundreds of errors. here's a chunk of it to look at: c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(91) : error C2143: syntax error : missing ')' before '*' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(91) : error C2143: syntax error : missing '{' before '*' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(91) : error C2059: syntax error : 'type' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(92) : error C2059: syntax error : ')' c:\program files\microsoft visual studio\myprojects\testrunfortestbed\xmltok_impl.c(129) : error C2143: syntax error : missing ')' before '*' And here's some code so you can have a little context for the errors:
///////////// LINE 89 HERE //////////////////////////// static int PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr != end) { if (!CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { *nextTokPtr = ptr; return XML_TOK_INVALID; } ptr += MINBPC(enc); while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { INVALID_CASES(ptr, nextTokPtr) case BT_MINUS: if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_COMMENT; } break; default: ptr += MINBPC(enc); break; } } } return XML_TOK_PARTIAL; }
I'm pretty stumped. Anybody know what the problem is? -
Well, here's the thing. I creating my classes in a project that was just a console application, then I made the MFC project for the demo. I moved all the files from the console application project into the MFC project folder, and when I tried compiling it didn't work, i got the errors listed. All the same stuff is included. I'm guessing there's a project setting somewhere that gets set one way for console and another way for MFC projects, and I need to switch it.
-
Well, here's the thing. I creating my classes in a project that was just a console application, then I made the MFC project for the demo. I moved all the files from the console application project into the MFC project folder, and when I tried compiling it didn't work, i got the errors listed. All the same stuff is included. I'm guessing there's a project setting somewhere that gets set one way for console and another way for MFC projects, and I need to switch it.
But the compiler is complaining about
ENCODING
. Where is it defined?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli