missing storage-class or type specifiers
-
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
-
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
Kranti1251984 wrote:
#include "CConfig.h"
Is it
#include "CConfig.h"
or#include "Config.h"
Nibu thomas Software Developer
-
Kranti1251984 wrote:
#include "CConfig.h"
Is it
#include "CConfig.h"
or#include "Config.h"
Nibu thomas Software Developer
I'm sorry, it is #include "Config.h"
-
I'm sorry, it is #include "Config.h"
Kranti1251984 wrote:
I'm sorry, it is #include "Config.h"
Now it should work!
Nibu thomas Software Developer
-
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
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
-
Kranti1251984 wrote:
I'm sorry, it is #include "Config.h"
Now it should work!
Nibu thomas Software Developer
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?
-
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
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.
-
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?
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 calledm_config
but here(inCDump
) you have declared a variable calledconfig
.
Nibu thomas Software Developer
-
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 calledm_config
but here(inCDump
) you have declared a variable calledconfig
.
Nibu thomas Software Developer
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