Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple definitions error

Status
Not open for further replies.

CINC

Programmer
Oct 30, 2001
17
0
0
US
cincship (Visitor) Sep 19, 2001
I'm using the Metrowerks Codewarrior compiler, and I am trying to do something like this in a for loop, inside a void function:

if ((structArray.info & someMask) == someMask)
{
cout << &quot;something&quot; << endl;
}

all I did was define three different masks globally in a header file then:
in a function in my implementation file, I used the bitwise or-- | --to set the above variable, using the masks, and based on a simple boolean expression
in another function in that same file I did the above with the same three masks

thank you
 
you have a couple of options.

1 put
#ifndef MASKS_H
#define MASKS_H

int maskLLow = 0xFF;
int maskULow = 0xFF00;

etc

#endif


into your header file... if this does not work. In a cpp file declare the masks

in the header file, do not put in the ifdefs and instead put

extern int maskLLow;
extern int maskULow;

etc..


Then include that h file everywhere you need the mask values

Matt

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top