I'm not 100% sure if this is your exact problem, but in reviewing my 2012 camera code, I noticed that I explicitly avoid getting an instance of the camera (i.e. connecting) in a constructor.
I use the following function to get a pointer to the camera whenever I want to use it:
Code:
AxisCamera *Camera::GetCamera()
{
static AxisCamera *camera = (AxisCamera *) 0;
if (camera == (AxisCamera *) 0)
{
AxisCamera &camRef = AxisCamera::GetInstance("10.24.74.11");
camera = &camRef;
}
return camera;
}
This way, you don't try to connect to the camera until the first time you use it.