2012-10-21 34 views
1

我試圖運行的OpenCV的cmake_android.cmd腳本詳見這裏: http://opencv.willowgarage.com/wiki/Android2.3.0#Windows_.28native.29Windows下的CMake OpenCV進行Android的......找不到的iostream

這樣我就可以得到一個OpenCV.mk文件與Android

使用

於是我開始cmd.exe的 當我在opencv\android 我跑scripts\cmake_android.cmd

它得到約3%,因爲它無法找到的iostream失敗

[ 3%] Building CXX object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o 
C:\opencv\3rdparty\libtiff\tif_stream.cxx:31:20: error: iostream: No such file or directory 

這是我wincfg.cmd文件

:: variables required for OpenCV build :: 
:: Note: all pathes should be specified without tailing slashes! 
SET ANDROID_NDK=C:\android-ndk-r8b-windows\android-ndk-r8b 
SET CMAKE_EXE=C:\Program Files (x86)\CMake 2.8\bin\cmake.exe 
SET MAKE_EXE=%ANDROID_NDK%\prebuilt\windows\bin\make.exe 

:: variables required for android-opencv build :: 
SET ANDROID_SDK=C:\Program Files (x86)\Android\android-sdk 
SET ANT_DIR=C:\opencv\android\apache-ant-1.8.4 
SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_09 

:: configuration options :: 
:::: general ARM-V7 settings 
SET ANDROID_ABI=armeabi-v7a 
SET BUILD_DIR=build 

:::: uncomment following lines to compile for old emulator or old device 
::SET ANDROID_ABI=armeabi 
::SET BUILD_DIR=build_armeabi 

:::: uncomment following lines to compile for ARM-V7 with NEON support 
::SET ANDROID_ABI=armeabi-v7a with NEON 
::SET BUILD_DIR=build_neon 

:::: uncomment following lines to compile for x86 
::SET ANDROID_ABI=x86 
::SET BUILD_DIR=build_x86 

:::: other options 
::SET ANDROID_NATIVE_API_LEVEL=8 &:: android-3 is enough for native part of OpenCV but android-8 is required for Java API 

任何援助不勝感激!

+0

這可能有所幫助:http://stackoverflow.com/questions/9130429/android-ndk-build-iostream-no-such-file-or-directory –

+0

謝謝,但我不想使用NDK編譯項目代碼。我正在嘗試使用cmake構建OpenCV – Vigrond

回答

2

對於NDK r8b,您需要存儲庫中的最新OpenCV。

OpenCV 2.4.2發行版支持從r5到r8的NDK。並且使用NDK r8編譯來自sourceforge和Google Play的預生成Android二進制文件。

+0

謝謝!我知道這一點,我想你在回答它的同時。我成功地編譯了一切。我的項目正在使用我的手機。真棒! – Vigrond