 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sun Apr 29, 2007 5:57 pm Post subject: C++ Linker error... I don't get it |
 |
|
|
|
I posted this on ssforum ... figured I'd post it here too, cause it's really blocking me now and I can't do anything >=(
----------------
I just started playing around with Merv stuff... but now I'm getting an error from the linker when it's building the exe:
Error 1 error LNK2019: unresolved external symbol "private: class timerms __thiscall botInfo::testtimer(void)" (?testtimer@botInfo@@AAE?AVtimerms@@XZ) referenced in function "public: void __thiscall botInfo::gotCommand(struct Player *,struct Command *)" (?gotCommand@botInfo@@QAEXPAUPlayer@@PAUCommand@@@Z) command.obj
The bug comes from the line:
int timervalue = testtimer().ReadTimer(); |
ReadTimer() is a int function of the class 'timerms'
I get linker errors anytime I call a non-void method within that class... wtf... What am i doing wrong?
Here's the relevant code... If you notice anything weird or stuff I shouldn't be doing, please tell me, even if it's not related to the problem... It's the first time I do C++
spawn.h [...]
#include "timerms.h"
[...]
class botInfo
{
// Put bot data here
timerms testtimer();
[...] |
commands.cpp
#include "spawn.h"
[...]
void botInfo::gotHelp(Player *p, Command *c)
{
[...]
int timervalue = testtimer().ReadTimer(); //Could be any other non-void call, it does the same error
[...] |
timerms.h
#include "spawn.h"
#define NOT_INITIALIZED -1
class timerms
{
int starttime;
int pausetime;
public:
timerms()
{
ResetTimer();
}
bool isrunning;
bool ispaused() { return (!isrunning && pausetime != NOT_INITIALIZED);}
void StartTimer(int starttime);
void StartTimer();
void PauseTimer(int pausetime);
void PauseTimer();
void ResumeTimer(int resumetime);
void ResumeTimer();
void ResetTimer();
int ReadTimer();
~timerms()
{
}
}; |
timerms.cpp
#include "spawn.h"
[...]
int timerms::ReadTimer()
{
return 0; //No matter what code in here, gives the same error
} |
I searched on Google and the only thing I found was about some libraries and stuff... but I'm not using any API or external dll or whatever...
Oh, and this is with Visual Studio 2005 pro _________________ (Insert a bunch of dead links here) |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 17 page(s) served in previous 5 minutes.
|