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. tons of awful errors

tons of awful errors

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++
3 Posts 2 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.
  • J Offline
    J Offline
    Jake Palmer
    wrote on last edited by
    #1

    My program has gone psycho, and I'd really appreciate some help reducing the 115 compilation errors down to none :-D The problem is with the VC++ generated line: static char THIS_FILE[] = __FILE__; that is placed in every cpp file. For some reason, this is giving me serious errors in every class! Looks something like this: error C2258: illegal pure syntax, must be '= 0' error C2252: 'THIS_FILE' : pure specifier can only be specified for functions error C2838: illegal qualified name in member declaration error C2059: syntax error : 'return' error C2238: unexpected token(s) preceding ';' error C2143: syntax error : missing ';' before '*' error C2501: 'GetMessageMap' : missing storage-class or type specifiers error C2556: 'int *__thiscall CTestApp::GetMessageMap(void) const' : overloaded function differs 43) : see declaration of 'GetMessageMap' error C2373: 'GetMessageMap' : redefinition; different type modifiers 43) : see declaration of 'GetMessageMap' error C2143: syntax error : missing ';' before 'tag::id' error C2734: 'AFX_MSGMAP' : const object must be initialized if not extern error C2371: 'AFX_MSGMAP' : redefinition; different basic types p(38) : see declaration of 'AFX_MSGMAP' fatal error C1004: unexpected end of file found Every one of those errors points to the BEGIN_MESSAGE_MAP macro. Needless to say, this is the lamest thing ever, and I don't have a clue what caused all this craziness. Any help is much needed X| thanks a ton, Jake

    R 1 Reply Last reply
    0
    • J Jake Palmer

      My program has gone psycho, and I'd really appreciate some help reducing the 115 compilation errors down to none :-D The problem is with the VC++ generated line: static char THIS_FILE[] = __FILE__; that is placed in every cpp file. For some reason, this is giving me serious errors in every class! Looks something like this: error C2258: illegal pure syntax, must be '= 0' error C2252: 'THIS_FILE' : pure specifier can only be specified for functions error C2838: illegal qualified name in member declaration error C2059: syntax error : 'return' error C2238: unexpected token(s) preceding ';' error C2143: syntax error : missing ';' before '*' error C2501: 'GetMessageMap' : missing storage-class or type specifiers error C2556: 'int *__thiscall CTestApp::GetMessageMap(void) const' : overloaded function differs 43) : see declaration of 'GetMessageMap' error C2373: 'GetMessageMap' : redefinition; different type modifiers 43) : see declaration of 'GetMessageMap' error C2143: syntax error : missing ';' before 'tag::id' error C2734: 'AFX_MSGMAP' : const object must be initialized if not extern error C2371: 'AFX_MSGMAP' : redefinition; different basic types p(38) : see declaration of 'AFX_MSGMAP' fatal error C1004: unexpected end of file found Every one of those errors points to the BEGIN_MESSAGE_MAP macro. Needless to say, this is the lamest thing ever, and I don't have a clue what caused all this craziness. Any help is much needed X| thanks a ton, Jake

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

      If you have any inline functions in your header file, make sure they have a matching {} pair. If you use an ")" instead of a "}", you'll get all kinds of bizarre errors. Also, make sure the statement inside the "{}" pair ends with a semi-colon. Lastly, if this is an abstract class, make sure you've completed the definitions inside the class header. If you're deriving forom an abstract class, the pure virtual functions have to be prototyped AND have a body.

      J 1 Reply Last reply
      0
      • R realJSOP

        If you have any inline functions in your header file, make sure they have a matching {} pair. If you use an ")" instead of a "}", you'll get all kinds of bizarre errors. Also, make sure the statement inside the "{}" pair ends with a semi-colon. Lastly, if this is an abstract class, make sure you've completed the definitions inside the class header. If you're deriving forom an abstract class, the pure virtual functions have to be prototyped AND have a body.

        J Offline
        J Offline
        Jake Palmer
        wrote on last edited by
        #3

        Sweet Jesus it actually worked! I had a non-inline function without the semicolon, and the compiler wasn't happy. Thanks a ton! :) Jake

        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