Solved

Error message confusion.

Posted on 1997-12-03
2
130 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

622 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