Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Error message confusion.

Posted on 1997-12-03
2
Medium Priority
?
131 Views
Last Modified: 2010-04-02
Hi,
Ok...Here's the function that I have:

void Set_Palette_Register(int index, RGB_color_ptr color)
{
    _outp(PALETTE_MASK, 0xff);

    _outp(PALETTE_REGISTER_WR, index);

    _outp(PALETTE_DATA,color->red);
    _outp(PALETTE_DATA,color->green);
    _outp(PALETTE_DATA,color->blue);
}
Now the error message says:
"error C2084: function 'Set_Palette_Register' a;ready has a body"
I'm using Microsoft C/C++ version 1.0, and you know how you can double click on the message and it'll zoom you to the excact line that the error is occuring; it takes me to the first braket '{' and as you can see there isn't anything else there. I'm at a total loss as to what the compiler means by that error So I was wondering if you could help.
Thank you,
Crash
0
Comment
Question by:crash020297
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 800 total points
ID: 1256491
What is probably happening is that either you have put this in a .h file and it has been included twice (hence the error).

Or you have put something like this in your .h file

void Set_Palette_Register(int index, RGB_color_ptr color) {}

instead of

void Set_Palette_Register(int index, RGB_color_ptr color);

Basically, you have the function written more than once (or the same definition being included more than once).

Just search for all occurences of the name and see where you define it with a body [ie. {...}]

Roger




0
 

Author Comment

by:crash020297
ID: 1256492
Thanks,
I can't believe I typed it twice. Isn't it the idea to have header files so you don't have to keep typing....
well, thank you very much.
crash
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question