NEED HELP WITH CODE :O

CMPC :: Computing :: Programming :: C++

Go down

NEED HELP WITH CODE :O

Post by Admin on Mon Jan 04, 2010 10:48 am

mediafire.com ?hnzynamzijg


that's my project. the files are a devc++ project but you can still read the txt files.



I'm having trouble compiling this because of the #include stuff. HELP AND EXPLAIN WHAT'S WRONG!
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Mon Jan 04, 2010 12:57 pm

i revised it a bit and now it compiles


mediafire.com ?m2zdmnygjwi


but did i do it properly? I think i kinda understand wtf i'm doing now

_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Paul on Mon Jan 04, 2010 8:07 pm

Wow. . .

1) Wait.h
change #define WAIT_H to #ifndef WAIT_H
change #ifdef WAIT_H to #define WAIT_H

2) Player.h
change #define PLAYER_H to #ifndef PLAYER_H
change #ifdef PLAYER_H to #define PLAYER_H

3) Castlevania.h
switch the order of your fist two lines #define to #ifndef and #ifndef to #define

4) Courtyard.h
same as above

5) Enemies.h
change #define to #ifndef
change #ifdef to #define

. . .

. . .



. . . . . . . . . .


forget it!
I'm just gunna email the fixed files to you
avatar
Paul
Pickaxe

Posts : 611

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Paul on Mon Jan 04, 2010 8:21 pm

basically you had the order backwards

check before defining

on some of them you forgot the n in #ifndef
avatar
Paul
Pickaxe

Posts : 611

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Tue Jan 05, 2010 4:06 am

oh yeah i forgot to post that i figured out that i needed to define before i checked.

_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Tue Jan 05, 2010 4:06 am

so it's all good now

_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Tue Jan 05, 2010 4:08 am

I sorta understood what i was doing in the "places" files (courtyard, inn, forest, castlevania)

but not sure what the player.h and enemies.h files are ifndef first and not define first.

_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Tue Jan 05, 2010 4:58 am

oh wait nevermind what i just said anyway.



What i did: changed all my files to


#ifndef filename
#define filename


#endif

but courtyard is #ifdef then #define. That seems to have the least errors. All it says is ....

in my main function it keeps saying that the courtyard function is undeclared even after checking that i included the courtyard function and it's spelled correctly.
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Tue Jan 05, 2010 5:13 am

mediafire.com ?hn0fzn0tm4n


new version


please find what's wrong and EXPLAIN. not just tell me what to fix.

_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Paul on Tue Jan 05, 2010 6:07 am

All the preprocessor stuff was correct and when I compiled it it compiled and ran just fine.
avatar
Paul
Pickaxe

Posts : 611

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Tue Jan 05, 2010 7:07 am

Admin wrote:mediafire.com ?hn0fzn0tm4n


new version


please find what's wrong and EXPLAIN. not just tell me what to fix.


do you mean this one had no errors? I'm using devC++ and i have all of this bullshit


keeps saying i have multiple definitions of a function. i'm guessing it's included twice or more.

Are you using VC++?
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Unchained on Wed Jan 06, 2010 4:57 am

Allen maybe you should set how strict the compiler is...
avatar
Unchained
Mod

Posts : 448

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Wed Jan 06, 2010 1:39 pm

Unchained wrote:Allen maybe you should set how strict the compiler is...
wow when i try it with my Quincy 2005 compiler everything works. But when I try it with DevC++ or VC++ it just fucks up in errors.


DAMMIT WHY!!


how do i set the strictness?
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Unchained on Thu Jan 07, 2010 12:11 am

Its different in every IDE, I left it as the default in VC++.

It looks like you just redefined a bunch of stuff.
avatar
Unchained
Mod

Posts : 448

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Admin on Thu Jan 07, 2010 12:14 am

that is



_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: NEED HELP WITH CODE :O

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

CMPC :: Computing :: Programming :: C++

 
Permissions in this forum:
You cannot reply to topics in this forum