Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why do I get : error C267: 'DrawString': requires ANSI-style prototype?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Activity points
9,442
Friends,

Why do I get : error C267: 'DrawString': requires ANSI-style prototype?

The code :
Code:
#define uchar unsigned char 

void DrawString(uint x, uint y, uchar *pStr, uint LineColor,uint FillColor, uchar Mod)

{

    while(1)
    {
        if (*pStr == 0)
        {
            return;
        }

        if (*pStr > 0x80)          
        {
            DrawSingleHz(x, y, pStr, LineColor, FillColor, Mod);
            x += HZ_column;
            pStr += 2;              
        }
        else                        
        {
            DrawSingleAscii(x, y, pStr, LineColor, FillColor, Mod);
            x += 8;
            pStr += 1;              
        }
    }   
}
//=================================

I call it with :
Code:
	DrawString(68, 0, "0", RED, YELLOW, NORMAL);

And got error :
error C267: 'DrawString': requires ANSI-style prototype

I think, I put all the input parameters correctly, but why is it happened ?

Thanks for helping
 
Last edited:

Not seen this type of error before, but first thing to check is are you declaring the function (i.e. either by using a function prototype, or
by having that function appear earlier in the file than the function that calls it)
before you are using it? If not, then you need to declare the function (i.e. have a function prototype) at the beginning of your file.
Also, what kind of compiler is it? is it a C++ compiler?
Maybe the compiler can't resolve the function call to the function declaration if the parameters look to be of the wrong type
(i.e. function overloading).
For instance, (just as an example) is 'NORMAL' definitely of type uchar?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top