# 2D based game, working on animation at the moment

This topic is 4443 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hellooo, this is my first post here, but I've been surfing the forums for a while. I'm working on a small 2D game in order to help familiarize myself with DirectX, (I'm using DX8) Anyway, when compiling my game, I get one error and 5 warnings that I need help with... I can post my entire program if you guys want it but for now I'll just post the build log.
------ Build started: Project: Bigger Fish, Configuration: Release Win32 ------
Compiling...
BiggerFish.cpp
.\BiggerFish.cpp(193) : warning C4996: 'strcpy' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\BiggerFish.cpp(203) : warning C4996: 'strcpy' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\BiggerFish.cpp(236) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\BiggerFish.cpp(246) : warning C4996: 'strcpy' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\BiggerFish.cpp(263) : warning C4996: 'strcpy' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
Build log was saved at "file://c:\Documents and Settings\Hillam\My Documents\Visual Studio 2005\Projects\Bigger Fish\Bigger Fish\Release\BuildLog.htm"
Bigger Fish - 1 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I am having the most trouble with that error in there, Most of this code is straight out of a book on 2D DirectX Programming, and so is that erroneous line, so I'll give you the function it resides in...
//////////////////////////////////////////////////////
// IsTimeForNextFrame()
//////////////////////////////////////////////////////
BOOL IsTimeForNextFrame()
{
static DWORD count = 0;
count = count + 1;
if (count > 100000)
{
count = 0;
return TRUE;
}
else
return FALSE;
}


the line in question is:
static DWORD count = 0;

Also, I was getting an error before telling me it didn't know where to find the .lib file "libci.lib" I checked out the platform SDK folder and it was there, but oddly enough it was a program debug database, and I was actually compiling in release mode... ?!? So why was it looking for a debug file when I was compiling in release mode? Anyway I told it where to find the file and then it shut up about it but now I get all these new errors... [Edited by - _Sauce_ on April 18, 2006 2:31:37 AM]

##### Share on other sites
Your count is 1/1000000 frames, not per x/milliseconds.... try passing in the amount of time passed between frames and see how that does.

##### Share on other sites
What language is that, Microsoft Visiual Studio 8? if so is it anything Microsoft Visiual Basic 6.0

##### Share on other sites
Your compiler can't see the definition of DWORD, BOOL, TRUE or FALSE at that point (they're not native to C++). You're most likely missing a Win32 header.

#include <windows.h> should fix it. Alternatively:

bool IsTimeForNextFrame(){    static unsigned long count = 0;    count = count + 1;    if (count > 100000)    {        count = 0;        return true;    }    else        return false;}

That will use intrinsic C++ types instead, to the same effect.

Quote:
 Original post by MishkiWhat language is that, Microsoft Visiual Studio 8? if so is it anything Microsoft Visiual Basic 6.0?

It's C++, using types from the Win32 API.

##### Share on other sites
Ahhh no wonder i couldnt understand it

##### Share on other sites
Ok, I was already compiling with #include <windows.h> at the top, so I went for your other solution... unfortunately I now get 4 errors and 3 warnings... I cannot tell you what these are however, because I use a seperate computer for programming and the net. dammit. Also, I made a mistake before, when I compile with libci.lib, it tells me I am compiling for the wrong platform instead of x86... not sure what file to use instead... so I left that link library outta there... would it be helpful for me to include my entire program here?

##### Share on other sites
Nevermind about it now, I fixed it and it works flawlessly :D

Thankyou Oluseyi that did help in the end! (I still had to change a few other things but without your suggestion it wouldn't have worked.)

• 17
• 11
• 12
• 9
• 49
• ### Forum Statistics

• Total Topics
631395
• Total Posts
2999757
×