You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System / Platform => macOS Sierra 10.12.1 / 64 Bit
Compiler => Android NDK r13 (using g++ 4.9)
Detailed description
Cannot build OpenCV shared libraries for android due to undefined references in hello-android/main.cpp. Build works fine if I just set the main method in hello-android/main.cpp to do nothing and return 0.
I cannot confirm. I just tried with ndk r10e and it failed as well. I am unable to read from the buildbot if DBUILD_SHARED_LIBS is set, because I only get this error when building the shared libs, static libs work fine.
cd platforms
export PATH=/home/declan/Documents/zone/mid/bin/android/google/sdk/cmake/3.6.3155560/bin:$PATH
export ANDROID_NDK=/home/declan/Documents/zone/mid/bin/android/google/sdk/ndk-bundle
scripts/cmake_android_arm.sh -DBUILD_SHARED_LIBS=ON -DANDROID_NATIVE_API_LEVEL=9 -DANDROID_STL=gnustl_shared
cd build_android_arm
make -j8
[ 60%] Built target opencv_superres /home/declan/Documents/zone/mid/bin/android/opencv/opencv_github_fork_dec1/samples/android/hello-android/main.cpp:16: error: undefined reference to 'cv::getTextSize(cv::String const&, int, double, int, int*)' /home/declan/Documents/zone/mid/bin/android/opencv/opencv_github_fork_dec1/samples/android/hello-android/main.cpp:18: error: undefined reference to 'cv::putText(cv::_InputOutputArray const&, cv::String const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' collect2: error: ld returned 1 exit status
Ive created a pull request that would resolve this:
System information (version)
Detailed description
Cannot build OpenCV shared libraries for android due to undefined references in hello-android/main.cpp. Build works fine if I just set the main method in hello-android/main.cpp to do nothing and return 0.
CMakeFiles/hello-android.dir/hello-android/main.cpp.o:main.cpp:function main: error: undefined reference to 'cv::getTextSize(cv::String const&, int, double, int, int*)'
CMakeFiles/hello-android.dir/hello-android/main.cpp.o:main.cpp:function main: error: undefined reference to 'cv::putText(cv::InputOutputArray const&, cv::String const&, cv::Point, int, double, cv::Scalar_, int, int, bool)'
collect2: error: ld returned 1 exit status
make[3]: *** [bin/hello-android] Error 1
make[2]: *** [samples/android/CMakeFiles/hello-android.dir/all] Error 2
Steps to reproduce
build with the following commands:
The text was updated successfully, but these errors were encountered: