Cannot Use OpenCV With -std=c++0x/gnu++0x in Fuerte
Compiling against OpenCV/FLANN in Fuerte/Ubuntu 12.04 amd64/gcc4.6 fails when using -std=c++0x due to this issue which has yet to be integrated into ROS; are there plans to pull this fix into ROS any time soon?
For example, the following simple test program:
#include <opencv/cv.h>
int main(){ return 0; }
when compiled with:
g++ opencv_test.cpp `pkg-config --libs --cflags opencv` -std=c++0x
will fail with:
error: ‘use_speed_’ was not declared in this scope
So far, I've been able to fix this issue by grabbing the latest OpenCV source (I'm using 2.4.9; issue was fixed in 2.4.3) and compiling/installing with:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/ros/fuerte
make
sudo make install
which appears to solve the issue, but is far from ideal. Are there any alternative workarounds for this issue? As far as I can tell, it is currently not possible to compile any code requiring both OpenCV and the c++0x/gnu++0x flag in fuerte out-of-the-box.