Skip to main content
gamedev.net
🔒 Locked

timerUpdate

Started by gamehunter101 7 replies 1.4k views
Original Post
gamehunter101
gamehunter101
i get this error 'timerUpdate': identifier not found every time i try to compile, im using visual c++ 05 and installed the sdk,can anyone help me,thanks #include "game.h" #include <windows.h> #include <conio.h>/*old c head*/ #include <iostream> using namespace std; bool Game::run(void) { char key =' ';/*=space*/ startTime=timeGetTime(); frameCount = 0; while (key!='q') { while(!getInput(&key)) { timerUpdate(); } cout<<"Here's what you pressed:"<<key<<endl; } cout<<frameCount<<endl; cout<<"End of the Game"<<endl; return true; } bool Game::getInput(char *c) { if(kbhit())/*if key is hit go here*/ { *c=getch(); return true; } return false; } void Game :: timeUpdate(void) { frameCount++; }
Daivuk
Daivuk
The function you are trying to call is timeUpdate(), not timerUpdate().

you code:
void Game :: timeUpdate(void){    frameCount++;}
gamehunter101
gamehunter101
Quote:
Original post by Daivuk
The function you are trying to call is timeUpdate(), not timerUpdate().


Error 3 error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: bool __thiscall Game::run(void)" (?run@Game@@QAE_NXZ) game.obj

i get that error when i change it
gamehunter101
gamehunter101
http://www.3dbuzz.com/vbforum/showpost.php?p=1064836&postcount=56

thats the problem i have
kritaya
kritaya
Have you added the library named 'winmm.lib' to your project yet ... ?
gamehunter101
gamehunter101
Quote:
Original post by kritaya
Have you added the library named 'winmm.lib' to your project yet ... ?


how do i do that
alchemar
alchemar
cin waits for input getch does not. he's trying to have the loop happen even if no input is to be had.
kritaya
kritaya
Quote:

Quote:
Original post by kritaya
Have you added the library named 'winmm.lib' to your project yet ... ?

how do i do that


Try to add this to your main.cpp:

#pragma comment(lib, "winmm.lib")


or

1. Right click on your project name in Solution Explorer, then select Properties.
2. In the left panel, select Configuration Properties -> Linker -> Input
3. In the right panel, find Additional Dependencies and put winmm.lib in the box.

I hope this helps.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.