Ask Your Question
0

OpenCV Java build issue with apps/visualisation and xobjdetect\tools\waldboost_detector

asked 2018-06-11 08:50:13 -0500

jayaise gravatar image

enabled Java wrappers and tried compiling using the cmake commands cmake.exe --build . --config Release --target Install

I am getting below errors:

Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\apps\visualisation\opencv_visualisation.vcxproj" (default ta rgets).

Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\ALL_BUILD.vcxproj" (default targets) -- FAILED.

Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\INSTALL.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\OpenCV-course\opencv-3.4.1\build\INSTALL.vcxproj" (default target) (1) -> "C:\OpenCV-course\opencv-3.4.1\build\ALL_BUILD.vcxproj" (default target) (3) -> "C:\OpenCV-course\opencv-3.4.1\build\modules\hdf\opencv_hdf.vcxproj" (default target) (51) -> (ClCompile target) -> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(737): warning C4267: 'initializing': conversi on from 'size_t' to 'int', possible loss of data [C:\OpenCV-course\opencv-3.4.1\build\modules\hdf\opencv_hdf.vcxproj]

"C:\OpenCV-course\opencv-3.4.1\build\INSTALL.vcxproj" (default target) (1) -> "C:\OpenCV-course\opencv-3.4.1\build\ALL_BUILD.vcxproj" (default target) (3) -> "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jni\opencv_java.vcxproj" (default target) (55) -> "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv_java_jar.vcxproj" (default target) (57) -> (CustomBuild target) -> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" e xited with code 1. [C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv_java_jar.vcxproj]

edit retag flag offensive close merge delete

Comments

hi ;)

the warnings you show, are probably NOT the reason for the build failing. there must be more errors some lines above, can you take another look ? (search for: error: )

also, if you're mainly interested in the java bindings, you can safely disable the apps and the xobjdetect module:

cmake -DBUILD_opencv_apps=OFF -DBUILD_opencv_xobjdetect=OFF
berak gravatar imageberak ( 2018-06-11 09:02:56 -0500 )edit

Generating opencv-341.jar Buildfile: C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv\build.xml

jar: [javac] Compiling 295 source files to C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv\build\classes [javac] C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv\java\org\opencv\hdf\HDF5.java:301: error: met hod dscreate(int,int,int,String,int,int) is already defined in class HDF5 [javac] public void dscreate(int rows, int cols, int type, String dslabel, int compresslevel, int dims_chunk s) [javac] ^ [javac] C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv\java\org\opencv\hdf\HDF5.java:329: error: met hod dscreate(int,int,int,String,int) is already defined in class HDF5

jayaise gravatar imagejayaise ( 2018-06-11 10:34:37 -0500 )edit

[javac] C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv\java\org\opencv\hdf\HDF5.java:329: error: met hod dscreate(int,int,int,String,int) is already defined in class HDF5 [javac] public void dscreate(int rows, int cols, int type, String dslabel, int compresslevel) [javac] ^ [javac] C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv\java\org\opencv\hdf\HDF5.java:343: error: met hod dscreate(int,int,int,String) is already defined in class HDF5 [javac] public void dscreate(int rows, int cols, int type, String dslabel) [javac] ^ [javac] 3 errors

jayaise gravatar imagejayaise ( 2018-06-11 10:36:42 -0500 )edit

I am getting above errors can you guide me

jayaise gravatar imagejayaise ( 2018-06-11 10:36:58 -0500 )edit

try to disable the hdf5 module:

cmake -DBUILD_opencv_hdf=OFF

(also, rather put code/errors like above into your question)

berak gravatar imageberak ( 2018-06-11 10:45:27 -0500 )edit

I added some more errors that I am facing in answer section, Can you please guide me

jayaise gravatar imagejayaise ( 2018-06-20 11:42:49 -0500 )edit

I was getting errors for videostab, I offed in build and tried building again. But again I am getting below errors ,but OpenCV-341.jar got generated and OpenCV-java341.dll file is not generated. while using the jar I am getting linkage errors:

C:\OpenCV-course\opencv-3.4.1\build\modules\java_bindings_generator\gen\cpp\shape.inl.hpp(1692): error C3861: 'Mat_to_vector_DMatch': identifier not found (compiling source file C:\OpenCV-course\opencv-3.4.1\mo dules\java\generator\src\cpp\opencv_java.cpp) [C:\OpenCV-course\opencv-3.4.1\build\modules\java\jni\opencv_java.vcxproj] features2d_converters.cpp Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jni\opencv_java.vcxproj" (default targets) -- FAILED.

Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\ALL_

jayaise gravatar imagejayaise ( 2018-06-20 11:59:24 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-06-20 11:26:25 -0500

jayaise gravatar image

Hi I did the above but now I am getting the below errors, I even added Wrap java in cmakeList.txt file Can you help me :

Project "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jni\opencv_java.vcxproj" (33) is building "C:\OpenCV-course\o pencv-3.4.1\build\modules\ts\opencv_ts.vcxproj" (45) on node 1 (default targets). InitializeBuildStatus: Creating "opencv_ts.dir\Release\opencv_ts.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. CustomBuild: All outputs are up-to-date. ClCompile: All outputs are up-to-date. All outputs are up-to-date. Lib: All outputs are up-to-date. opencv_ts.vcxproj -> C:\OpenCV-course\opencv-3.4.1\build\lib\Release\opencv_ts341.lib FinalizeBuildStatus: Deleting file "opencv_ts.dir\Release\opencv_ts.tlog\unsuccessfulbuild". Touching "opencv_ts.dir\Release\opencv_ts.tlog\opencv_ts.lastbuildstate". Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\modules\ts\opencv_ts.vcxproj" (default targets).

Project "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jni\opencv_java.vcxproj" (33) is building "C:\OpenCV-course\o pencv-3.4.1\build\modules\videostab\opencv_videostab.vcxproj" (46) on node 1 (default targets). InitializeBuildStatus: Creating "opencv_videostab.dir\Release\opencv_videostab.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. CustomBuild: All outputs are up-to-date. ClCompile: All outputs are up-to-date. All outputs are up-to-date. Lib: All outputs are up-to-date. opencv_videostab.vcxproj -> C:\OpenCV-course\opencv-3.4.1\build\lib\Release\opencv_videostab341.lib FinalizeBuildStatus: Deleting file "opencv_videostab.dir\Release\opencv_videostab.tlog\unsuccessfulbuild". Touching "opencv_videostab.dir\Release\opencv_videostab.tlog\opencv_videostab.lastbuildstate". Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\modules\videostab\opencv_videostab.vcxproj" (default targets ).

Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jni\opencv_java.vcxproj" (default targets) -- F AILED.

Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\ALL_BUILD.vcxproj" (default targets) -- FAILED.

Done Building Project "C:\OpenCV-course\opencv-3.4.1\build\INSTALL.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\OpenCV-course\opencv-3.4.1\build\INSTALL.vcxproj" (default target) (1) -> "C:\OpenCV-course\opencv-3.4.1\build\ALL_BUILD.vcxproj" (default target) (3) -> "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jni\opencv_java.vcxproj" (default target) (33) -> "C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv_java_jar.vcxproj" (default target) (35) -> (CustomBuild target) -> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" e xited with code 1. [C:\OpenCV-course\opencv-3.4.1\build\modules\java\jar\opencv_java_jar.vcxproj]

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:13.05

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-11 08:50:13 -0500

Seen: 283 times

Last updated: Jun 20 '18