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. Compiling errors

Compiling errors

Scheduled Pinned Locked Moved C / C++ / MFC
c++questioncsharpvisual-studiocom
5 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.
  • F Offline
    F Offline
    FlyingDancer
    wrote on last edited by
    #1

    http://www.codeproject.com/dialog/msgboxdemo.asp?df=100&forumid=1419&exp=0&select=632516#xx632516xx According to the above, I created a MFC-AppWizard exe project(Dialog-based) and added the files "timedmsgbox.cpp" and "timedmsgbox.h" to it,then changed the afximpl.h path as: #include "C:\\Program Files\\Microsoft Visual Studio\\VC98\\MFC\\SRC\\afximpl.h" My computer's OS is WindowsXP sp2 Compiling tool is VC6 The compiling result is like the below How can I solve these problems? Compiling... timedmsgbox.cpp d:\projects\timedmsgboxtest\timedmsgbox.h(44) : error C2146: syntax error : missing ';' before identifier 'm_sectMap' d:\projects\timedmsgboxtest\timedmsgbox.h(44) : error C2501: 'm_sectMap' : missing storage-class or type specifiers D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2039: 'm_sectMap' : is not a member of 'CDlgTimedMessageBox' d:\projects\timedmsgboxtest\timedmsgbox.h(23) : see declaration of 'CDlgTimedMessageBox' D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2146: syntax error : missing ';' before identifier 'm_sectMap' D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2501: 'CCriticalSection' : missing storage-class or type specifiers D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : fatal error C1004: unexpected end of file found Error executing cl.exe. TimedMsgBoxTest.exe - 6 error(s), 0 warning(s)

    M A 2 Replies Last reply
    0
    • F FlyingDancer

      http://www.codeproject.com/dialog/msgboxdemo.asp?df=100&forumid=1419&exp=0&select=632516#xx632516xx According to the above, I created a MFC-AppWizard exe project(Dialog-based) and added the files "timedmsgbox.cpp" and "timedmsgbox.h" to it,then changed the afximpl.h path as: #include "C:\\Program Files\\Microsoft Visual Studio\\VC98\\MFC\\SRC\\afximpl.h" My computer's OS is WindowsXP sp2 Compiling tool is VC6 The compiling result is like the below How can I solve these problems? Compiling... timedmsgbox.cpp d:\projects\timedmsgboxtest\timedmsgbox.h(44) : error C2146: syntax error : missing ';' before identifier 'm_sectMap' d:\projects\timedmsgboxtest\timedmsgbox.h(44) : error C2501: 'm_sectMap' : missing storage-class or type specifiers D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2039: 'm_sectMap' : is not a member of 'CDlgTimedMessageBox' d:\projects\timedmsgboxtest\timedmsgbox.h(23) : see declaration of 'CDlgTimedMessageBox' D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2146: syntax error : missing ';' before identifier 'm_sectMap' D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2501: 'CCriticalSection' : missing storage-class or type specifiers D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : fatal error C1004: unexpected end of file found Error executing cl.exe. TimedMsgBoxTest.exe - 6 error(s), 0 warning(s)

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Add <afxmt.h> to your StdAfx.h header file, then Rebuild All.

      F 1 Reply Last reply
      0
      • F FlyingDancer

        http://www.codeproject.com/dialog/msgboxdemo.asp?df=100&forumid=1419&exp=0&select=632516#xx632516xx According to the above, I created a MFC-AppWizard exe project(Dialog-based) and added the files "timedmsgbox.cpp" and "timedmsgbox.h" to it,then changed the afximpl.h path as: #include "C:\\Program Files\\Microsoft Visual Studio\\VC98\\MFC\\SRC\\afximpl.h" My computer's OS is WindowsXP sp2 Compiling tool is VC6 The compiling result is like the below How can I solve these problems? Compiling... timedmsgbox.cpp d:\projects\timedmsgboxtest\timedmsgbox.h(44) : error C2146: syntax error : missing ';' before identifier 'm_sectMap' d:\projects\timedmsgboxtest\timedmsgbox.h(44) : error C2501: 'm_sectMap' : missing storage-class or type specifiers D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2039: 'm_sectMap' : is not a member of 'CDlgTimedMessageBox' d:\projects\timedmsgboxtest\timedmsgbox.h(23) : see declaration of 'CDlgTimedMessageBox' D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2146: syntax error : missing ';' before identifier 'm_sectMap' D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : error C2501: 'CCriticalSection' : missing storage-class or type specifiers D:\projects\TimedMsgBoxTest\timedmsgbox.cpp(28) : fatal error C1004: unexpected end of file found Error executing cl.exe. TimedMsgBoxTest.exe - 6 error(s), 0 warning(s)

        A Offline
        A Offline
        Anand Paranjpe
        wrote on last edited by
        #3

        Hi, I hope you have solved the current problem as replied by Mike. When u get error as above, "error C2501: 'CCriticalSection' : missing storage-class or type specifiers", immidiately search "CCriticalSection" on MSDN. There you will get header file u need to include. Compiler follows set of instructions. If u forget including header files, it will throw error like above. Error numbers reported by VC compilers are described in detail on MSDN. If u get compiler concepts clear, u will never face problem in solving such errors. The chosen One :)

        F 1 Reply Last reply
        0
        • M Mike Dimmick

          Add <afxmt.h> to your StdAfx.h header file, then Rebuild All.

          F Offline
          F Offline
          FlyingDancer
          wrote on last edited by
          #4

          It work well now Thank you!

          1 Reply Last reply
          0
          • A Anand Paranjpe

            Hi, I hope you have solved the current problem as replied by Mike. When u get error as above, "error C2501: 'CCriticalSection' : missing storage-class or type specifiers", immidiately search "CCriticalSection" on MSDN. There you will get header file u need to include. Compiler follows set of instructions. If u forget including header files, it will throw error like above. Error numbers reported by VC compilers are described in detail on MSDN. If u get compiler concepts clear, u will never face problem in solving such errors. The chosen One :)

            F Offline
            F Offline
            FlyingDancer
            wrote on last edited by
            #5

            Great! What a good lesson! I don't know what to do about these errors before. Thanks a lot for both of you! :rose::rose::rose:

            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