[SOLVED] Strange problem with header file

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Bullet Pulse
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 89
Joined: Sun Feb 21, 2010 6:25 pm

[SOLVED] Strange problem with header file

Post by Bullet Pulse »

Nevermind.
Last edited by Bullet Pulse on Wed Feb 16, 2011 4:47 pm, edited 2 times in total.
Image
Live-Dimension
Chaos Rift Junior
Chaos Rift Junior
Posts: 345
Joined: Tue Jan 12, 2010 7:23 pm
Favorite Gaming Platforms: PC - Windows 7
Programming Language of Choice: c++;haxe
Contact:

Re: Strange problem with header file

Post 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.
Image
User avatar
Bullet Pulse
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 89
Joined: Sun Feb 21, 2010 6:25 pm

Re: Strange problem with header file

Post by Bullet Pulse »

Nevermind.
Last edited by Bullet Pulse on Wed Feb 16, 2011 4:47 pm, edited 1 time in total.
Image
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: [SOLVED] Strange problem with header file

Post 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.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Post Reply