baxybaxy
December 7th, 2006, 05:13 AM
Hi all,
Disclosure- i'm a beginner! (this will become apparent)
I am having horrible problems trying to get to grips with namespaces, #include statements etc.... I cannot get the basic rules right on how to arrange the code so that it compiles correctly every time
Can anyone point me in the right direction for an article on this, or perhaps help on the specific example below:
I have a static function :
static void Metric_set_rollingmeanValue(int phase, int metricnumber, int location, double value, int count)
{
....
}
-> resides in my code header staticData.h -> deals with a small number of global variables
also in staticData.h, I have a enumerator
public enum metricnumber {
leadtime_metricnumber,
order_volIntake,order_volShipped,order_volFilled,
order_numordIntake,order_numordShipped,order_numordFilled,
order_growth......
from my main form, Form1, I am able to reference this data ok
for example:
Metric_set_rollingmeanValue(phase,leadtime_metricnumber,location, leadtime, countdata[phase][location]);
However, when I try and call the same function from another class
(my Order class), I get errors like:
Error 3 error C3861: 'Metric_set_relValue': identifier not found
Error 5 error C2365: 'Metric_set_relValue' : redefinition; previous definition was 'formerly unknown identifier'
Error 1 error C2653: 'metricnumber' : is not a class or namespace name
Does this hold any clues for what I am doing wrong?
Thank you very much in advance for any help
Disclosure- i'm a beginner! (this will become apparent)
I am having horrible problems trying to get to grips with namespaces, #include statements etc.... I cannot get the basic rules right on how to arrange the code so that it compiles correctly every time
Can anyone point me in the right direction for an article on this, or perhaps help on the specific example below:
I have a static function :
static void Metric_set_rollingmeanValue(int phase, int metricnumber, int location, double value, int count)
{
....
}
-> resides in my code header staticData.h -> deals with a small number of global variables
also in staticData.h, I have a enumerator
public enum metricnumber {
leadtime_metricnumber,
order_volIntake,order_volShipped,order_volFilled,
order_numordIntake,order_numordShipped,order_numordFilled,
order_growth......
from my main form, Form1, I am able to reference this data ok
for example:
Metric_set_rollingmeanValue(phase,leadtime_metricnumber,location, leadtime, countdata[phase][location]);
However, when I try and call the same function from another class
(my Order class), I get errors like:
Error 3 error C3861: 'Metric_set_relValue': identifier not found
Error 5 error C2365: 'Metric_set_relValue' : redefinition; previous definition was 'formerly unknown identifier'
Error 1 error C2653: 'metricnumber' : is not a class or namespace name
Does this hold any clues for what I am doing wrong?
Thank you very much in advance for any help