Log in or register to post comments

error

June 11, 2013 - 7:47am #1

I have an error (expected initializer before '&' token )with the following line:

const QCAR::ImageTarget& imageTarget = (const QCAR::ImageTarget&) result->getTrackable();

I don't know why

error

June 11, 2013 - 11:47pm #4

Thanks :-).

Yes an static_cast would be faster because it performs no runtime checks. In this case it is appropriate because we know that the refer to the object is an ImageTarget object, and thus a check would be unnecessary.

 

error

June 11, 2013 - 1:59pm #3

Hi, good to see you found the solution already.

BTW: if I may suggest a small code "improvement" on the C++ side, you could use:

const QCAR::ImageTarget& imageTarget = static_cast<const QCAR::ImageTarget&>( result->getTrackable() );

instead of

const QCAR::ImageTarget& imageTarget = (const QCAR::ImageTarget&) result->getTrackable();

 

error

June 11, 2013 - 7:52am #2

#include <QCAR/ImageTarget.h>

is needed.

Log in or register to post comments