Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Compiles fine, then doesn't...

Compiles fine, then doesn't...

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studioxml
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    the_augy
    wrote on last edited by
    #1

    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?

    R 1 Reply Last reply
    0
    • T the_augy

      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?

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      the_augy wrote:

      ENCODING

      Are you including the header file where this is defined ? ~RaGE();

      T 1 Reply Last reply
      0
      • R Rage

        the_augy wrote:

        ENCODING

        Are you including the header file where this is defined ? ~RaGE();

        T Offline
        T Offline
        the_augy
        wrote on last edited by
        #3

        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.

        D 1 Reply Last reply
        0
        • T the_augy

          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.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups