Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Problem with errors.

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 12th Jun 2008 18:42
I have made a code for gravity and jumping physics. It isn't done, but i got a lot of errors that I don't know how to solve...

the code


The errors

I know how to solve some of the errors like the syntax ones, but the one where it says

c:\users\byron\documents\visual studio 2008\projects\global warfare\global warfare\main.cpp(80) : error C2065: 'BJump' : undeclared identifier

I don't know how to solve... Also the one that says

c:\users\byron\documents\visual studio 2008\projects\global warfare\global warfare\main.cpp(80) : warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation

Thanks.

Global Warfare
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 12th Jun 2008 19:35
Your functions cannot see variables you've declared outside of its scope that aren't in the global scope, i.e. every variable you get an error about, to fix this place 'bool BJump = false;' 'bool BGravity = false;' and all the others it complains about before your entry point function, in the global scope. These variables will now be visible anywhere in that file after its declaration.

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 12th Jun 2008 19:44
So I put it before the void DarkGDK (void); ?

That would make sense..... Thanks.

Global Warfare
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 12th Jun 2008 20:10 Edited at: 12th Jun 2008 20:11
Quote: "So I put it before the void DarkGDK (void); ?"


Yep. And bear in mind that if you declare a variable with the same identifier inside another scope (function or block, for example) it will use that variable while executing in that scope instead, without affecting the one with global scope.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 12th Jun 2008 20:16
ok, I got it now. My problem is this- It won't load!!!! Nohing is wrong with it, the problem is that it is too much to procces. Is there a ways of shrincking the load time?

The code


Thanks

Global Warfare

Login to post a reply

Server time is: 2024-09-29 23:33:27
Your offset time is: 2024-09-29 23:33:27