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. missing storage-class or type specifiers

missing storage-class or type specifiers

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
9 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.
  • K Offline
    K Offline
    Kranti1251984
    wrote on last edited by
    #1

    Hi, I'm getting following errors while creating 3 classes as mentioned below ... //--------------------------- class CConfig { //declarations }; //--------------------------- #include "Config.h" class CDlg { CConfig m_config; //no errors }; //--------------------------- #include "Config.h" class CDump { void MyFun(CConfig config); //errors }; //--------------------------- in class CDump i'm getting some errors as ... error C2146: syntax error : missing ';' before identifier 'config' error C2501: 'CConfig' : missing storage-class or type specifiers error C2501: 'config' : missing storage-class or type specifiers as far as class CDlg is concerned i'm able to declare and use the object of CConfig but why doesn't it work in the other case? Thanks, Kranti -- modified at 23:59 Monday 6th March, 2006

    N G 2 Replies Last reply
    0
    • K Kranti1251984

      Hi, I'm getting following errors while creating 3 classes as mentioned below ... //--------------------------- class CConfig { //declarations }; //--------------------------- #include "Config.h" class CDlg { CConfig m_config; //no errors }; //--------------------------- #include "Config.h" class CDump { void MyFun(CConfig config); //errors }; //--------------------------- in class CDump i'm getting some errors as ... error C2146: syntax error : missing ';' before identifier 'config' error C2501: 'CConfig' : missing storage-class or type specifiers error C2501: 'config' : missing storage-class or type specifiers as far as class CDlg is concerned i'm able to declare and use the object of CConfig but why doesn't it work in the other case? Thanks, Kranti -- modified at 23:59 Monday 6th March, 2006

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      Kranti1251984 wrote:

      #include "CConfig.h"

      Is it #include "CConfig.h" or #include "Config.h"


      Nibu thomas Software Developer

      K 1 Reply Last reply
      0
      • N Nibu babu thomas

        Kranti1251984 wrote:

        #include "CConfig.h"

        Is it #include "CConfig.h" or #include "Config.h"


        Nibu thomas Software Developer

        K Offline
        K Offline
        Kranti1251984
        wrote on last edited by
        #3

        I'm sorry, it is #include "Config.h"

        N 1 Reply Last reply
        0
        • K Kranti1251984

          I'm sorry, it is #include "Config.h"

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          Kranti1251984 wrote:

          I'm sorry, it is #include "Config.h"

          Now it should work!


          Nibu thomas Software Developer

          K 1 Reply Last reply
          0
          • K Kranti1251984

            Hi, I'm getting following errors while creating 3 classes as mentioned below ... //--------------------------- class CConfig { //declarations }; //--------------------------- #include "Config.h" class CDlg { CConfig m_config; //no errors }; //--------------------------- #include "Config.h" class CDump { void MyFun(CConfig config); //errors }; //--------------------------- in class CDump i'm getting some errors as ... error C2146: syntax error : missing ';' before identifier 'config' error C2501: 'CConfig' : missing storage-class or type specifiers error C2501: 'config' : missing storage-class or type specifiers as far as class CDlg is concerned i'm able to declare and use the object of CConfig but why doesn't it work in the other case? Thanks, Kranti -- modified at 23:59 Monday 6th March, 2006

            G Offline
            G Offline
            Ghasrfakhri
            wrote on last edited by
            #5

            I have this problem when I have 2 or more file Included eachothere (file 1 include file 2 & file 2 include file 1) Iman Ghasrfakhri

            K 1 Reply Last reply
            0
            • N Nibu babu thomas

              Kranti1251984 wrote:

              I'm sorry, it is #include "Config.h"

              Now it should work!


              Nibu thomas Software Developer

              K Offline
              K Offline
              Kranti1251984
              wrote on last edited by
              #6

              No, that's the problem. Even though, correct header file is included, it works fine with CDlg but not with CDump. What should I do?

              N 1 Reply Last reply
              0
              • G Ghasrfakhri

                I have this problem when I have 2 or more file Included eachothere (file 1 include file 2 & file 2 include file 1) Iman Ghasrfakhri

                K Offline
                K Offline
                Kranti1251984
                wrote on last edited by
                #7

                I had tried this. But logically, it should not work and it doesn't work. But the problem i've mentioned is not the same one.

                1 Reply Last reply
                0
                • K Kranti1251984

                  No, that's the problem. Even though, correct header file is included, it works fine with CDlg but not with CDump. What should I do?

                  N Offline
                  N Offline
                  Nibu babu thomas
                  wrote on last edited by
                  #8

                  I don't think that the line you are showing is having the problem in CDump because the errors are talking about some other variable called m_config but here(in CDump) you have declared a variable called config.


                  Nibu thomas Software Developer

                  K 1 Reply Last reply
                  0
                  • N Nibu babu thomas

                    I don't think that the line you are showing is having the problem in CDump because the errors are talking about some other variable called m_config but here(in CDump) you have declared a variable called config.


                    Nibu thomas Software Developer

                    K Offline
                    K Offline
                    Kranti1251984
                    wrote on last edited by
                    #9

                    The same line with prototype of the function, is creating problems for the variable config of type CConfig. -- modified at 0:02 Tuesday 7th March, 2006

                    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