Create OpenCV with Java Support on Mac OS X (64-bit)

Following the directions of http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html , I come across this:

make -j8
...
...
Linking the CXX shared library ../../ lib / libopencv_java244.dylib
ld: unknown option: -all archive
clang: error: linker command failed with exit code 1 (use -v to calling the call)
make [2]: * [lib / libopencv_java244.dylib] Error 1
make [1]: *
[modules / java / CMakeFiles / opencv_java.dir / all] Error 2
make: *** [all] Error 2

Any suggestions?

+5
source share
4

! , ld Unix OS X. , :

ld: unknown option: -whole-archive

, modules/java/CMakeLists.txt, OS X. ( -whole-archive)

:

target_link_libraries(${the_module} -Wl,-whole-archive ${__deps} -Wl,-no-whole-archive ${__extradeps} ${OPENCV_LINKER_LIBS})

:

foreach(_dep ${__deps})
  target_link_libraries(${the_module} -Wl,-force_load "${_dep}")
endforeach()

, .:)

- Edit -
( !); . -force_load , , foreach. , , , -Wl. . pull request 741 git .

+2

OpenCV Homebrew.

, , :

brew tap homebrew/science
brew install opencv --with-java

opencv.

, jar

/usr/local/Cellar/opencv/2.4.9/share/OpenCV/java/

opencv path

+23

, . , CMake. OpenCV 2.4.4 Java, ccmake:

cd OpenCV-2.4.4
mkdir build
cd build
ccmake ..

, BUILD_opencv_java - ON ( ) Opencv java

:

  • configure (c)
  • generate (g)
  • make, make install

Java, x86_64, osx 10.8:

+4

My solution for this was to use a MacPort installation ... it puts everything you need and you have no problems with configuration, builds, etc ...

Just install MacPort and run: "sudo port install opencv + java"

for more details: http://ladstatt.blogspot.com.br/2013/04/opencv-on-macosx-with-java-support.html

+4
source

All Articles