nebc
July 24th, 2006, 01:24 PM
I'm having problems with default arguments in C++. The CamState files
compile just fine but I get an error when I try and compile fvcart.cpp. Here's the error:
../../objdir/FvCartPanel.o(.text+0x3a3c): In function `FvCartPanel::UpdateImage()':
pathcode/fvcart/FvCartPanel.cpp:292: undefined reference to `CamState::still()'
collect2: ld returned 1 exit status
code in FvCartPanel
-------------------------------------------
if(but2->isChecked())
{
if(csp->still()){
// assuming that we've already moved here
posp.set(hs/2, ws/2);
//....
-------------------------------------------
csp is a CamState object
void moveToAbsPanTilt(int pan, int tilt);
bool still(double time = 0.001);
void set_framerate(int framerate);
-------------------------------------------
Here is the CamState.cpp
bool CamState::still(double time) {
/* has the camera stopped moving? - using a hack for
now, absolute amount of time since last movment */
//if (motortimer.elapsed() > 500) // used to be 800
// 500 wasn't working at all. Kept on saying that camera had moved
// to recently this value seems to work well -BC
if (motortimer.elapsed() > time)
return true;
else
return false;
}
-------------------------------------------
Anyone know what I'm doing wrong?
compile just fine but I get an error when I try and compile fvcart.cpp. Here's the error:
../../objdir/FvCartPanel.o(.text+0x3a3c): In function `FvCartPanel::UpdateImage()':
pathcode/fvcart/FvCartPanel.cpp:292: undefined reference to `CamState::still()'
collect2: ld returned 1 exit status
code in FvCartPanel
-------------------------------------------
if(but2->isChecked())
{
if(csp->still()){
// assuming that we've already moved here
posp.set(hs/2, ws/2);
//....
-------------------------------------------
csp is a CamState object
void moveToAbsPanTilt(int pan, int tilt);
bool still(double time = 0.001);
void set_framerate(int framerate);
-------------------------------------------
Here is the CamState.cpp
bool CamState::still(double time) {
/* has the camera stopped moving? - using a hack for
now, absolute amount of time since last movment */
//if (motortimer.elapsed() > 500) // used to be 800
// 500 wasn't working at all. Kept on saying that camera had moved
// to recently this value seems to work well -BC
if (motortimer.elapsed() > time)
return true;
else
return false;
}
-------------------------------------------
Anyone know what I'm doing wrong?