CMPC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

NEED HELP WITH CODE :O

3 posters

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

Go down

NEED HELP WITH CODE :O Empty NEED HELP WITH CODE :O

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

http://www.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!
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

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

i revised it a bit and now it compiles


http://www.mediafire.com/?m2zdmnygjwi


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

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

Post by Paul 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
Paul
Paul
Pickaxe

Posts : 611

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

Post by Paul 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
Paul
Paul
Pickaxe

Posts : 611

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

Post by Admin 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.
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

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

so it's all good now
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

Post by Admin 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.
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

Post by Admin 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.
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

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

http://www.mediafire.com/?hn0fzn0tm4n


new version


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

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

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

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

Posts : 611

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

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

Admin wrote:http://www.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

NEED HELP WITH CODE :O Bullshitl
keeps saying i have multiple definitions of a function. i'm guessing it's included twice or more.

Are you using VC++?
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

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

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

Posts : 448

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

Post by Admin 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?
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

Post by Unchained 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.
Unchained
Unchained
Mod

Posts : 448

Back to top Go down

NEED HELP WITH CODE :O Empty Re: NEED HELP WITH CODE :O

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

that is


NEED HELP WITH CODE :O Unbranded-bullshit-stamp
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

NEED HELP WITH CODE :O Empty 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