在Eclipse中使用OpenCV和JNI部分構建android應用程序時遇到了問題。在Eclipse中使用JNI構建OpenCV應用程序
問題比NDK,構建正常運行的項目,但是Eclipse顯示錯誤(通常是無關的代碼)。
例如,我正在創建的OpenCV4Android樣本之一:
[email protected]:~/src/OpenCV-2.4.3-android-sdk/samples/tutorial-3-native$ ndk-build
Install : libnative_camera_r2.2.0.so => libs/armeabi-v7a/libnative_camera_r2.2.0.so
Install : libnative_camera_r2.3.3.so => libs/armeabi-v7a/libnative_camera_r2.3.3.so
Install : libnative_camera_r3.0.1.so => libs/armeabi-v7a/libnative_camera_r3.0.1.so
Install : libnative_camera_r4.0.0.so => libs/armeabi-v7a/libnative_camera_r4.0.0.so
Install : libnative_camera_r4.0.3.so => libs/armeabi-v7a/libnative_camera_r4.0.3.so
Install : libnative_camera_r4.1.1.so => libs/armeabi-v7a/libnative_camera_r4.1.1.so
Install : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so
Install : libopencv_java.so => libs/armeabi-v7a/libopencv_java.so
它運行正常,但是Eclipse顯示錯誤:
'size_t' is ambiguous '
Candidates are:
Field 'pt' could not be resolved
Field 'pt' could not be resolved
Field 'x' could not be resolved
Field 'y' could not be resolved
Invalid arguments '
Candidates are:
void detect(const cv::Mat &, ? &, const cv::Mat &)
void detect(const ? &, ? &, const ? &)
The type 'cv::FastFeatureDetector' must implement the inherited pure virtual method 'cv::FeatureDetector::detectImpl'
和其他錯誤這樣一個在其他項目中。而且,Eclipse intellisense(或者它是如何正確調用的)不能用於.cpp文件。
我試圖清理項目,刪除OBJ和lib文件夾,但沒有效果。
我的系統是Ubuntu 12.04,OpenCV版本是2.4.3。
感謝您的幫助!
你有沒有安裝NDK插件?:http://tools.android.com/recent/usingthendkplugin –
是的,當然。 (放大評論:) –