Page 1 of 1

[SOLVED] Strange problem with header file

Posted: Sat Apr 03, 2010 6:02 pm
by Bullet Pulse
Nevermind.

Re: Strange problem with header file

Posted: Sat Apr 03, 2010 6:54 pm
by Live-Dimension
Stop feeding the source code to your dog?

Seriously, We need to see some code if we're going to be able to help.

Re: Strange problem with header file

Posted: Sat Apr 03, 2010 7:15 pm
by Bullet Pulse
Nevermind.

Re: [SOLVED] Strange problem with header file

Posted: Sun Apr 04, 2010 1:17 am
by Ginto8
Bullet Pulse wrote:Ok, so I figured it out.

When I changed the code from:

Code: Select all

bool selected;
bool highlighted;
Uint32 colorKey;
bool set;
int example;

to:

Code: Select all

bool selected;
bool set;
bool highlighted;
Uint32 colorKey;
int example;
it started working fine.

Do the types have to be in a certain order?

EDIT: This problem was happening because I was using Code::Blocks. Now that I'm using VC++, I'm not having the problem anymore.
Bullet Pulse wrote:Whenever I try to declare a new variable in a particular header file within my program, the program gets screwed up.
It doesn't matter what variable type or name is, or even if it's being used, it messes up my program.
This particular header file has several bools, and a Uint already declared; but again, if I try to add more variables, the program gets screwed up.

Anyone have an idea why?
Could you provide some more information? For example, what the error was? Both of those pieces of code should work fine, whether it's minGW or MSVC++ compiled. Vaguely defining a problem and then saying you found the solution, and saying what the solution was (without finishing the description of the problem) is of little or no help to those who may end up with the same problem, because they will have no clue whether or not your problem is in any way similar to theirs.