errors when building opencv 4.5.0 wit extra modules using Mingw [closed]

asked 2020-12-07 14:26:14 -0500

fafafafa gravatar image

please help!!!! I I am building opencv with extra modules for java using Mingw and cmake , and get some errors in the console what can be the reason !!!!


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2020-12-10 10:53:55.886848



g++ --version

please ?

berak gravatar imageberak ( 2020-12-07 14:52:47 -0500 )edit

@berak , thanks for replying!, is there any probleme with the version ! it's g++ 4.7.1

fafafafa gravatar imagefafafafa ( 2020-12-07 14:56:23 -0500 )edit
berak gravatar imageberak ( 2020-12-07 15:12:12 -0500 )edit

thanks a lot for your time sir , I am going to try this version right now

fafafafa gravatar imagefafafafa ( 2020-12-07 15:16:42 -0500 )edit

is there any problem with that version ?

for sure, it's lacking any c++11 support, Mutex, etc.

but please report back !

berak gravatar imageberak ( 2020-12-07 15:25:20 -0500 )edit

you'll also need to set

OPENCV_ENABLE_ALLOCATOR_STATS=OFF in cmake, to get it compiled
berak gravatar imageberak ( 2020-12-07 16:05:56 -0500 )edit

@berak of course I will do! it might be a stupide question but didn't find the bin folder to add to the system path in this mingw version

fafafafa gravatar imagefafafafa ( 2020-12-07 16:14:33 -0500 )edit

@berak thanks a lot Sir!!!! changing the version of my g++ resolved the problem , now I get opencv_450.jar in the bin folder and , libopencv_java450.dll in the lib folder , trying now to run a programm but got an error in this line:


and also when changing it to :


the error is:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Mini\Downloads\es\lib\libopencv_java450.dll: Can't find dependent libraries
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$
fafafafa gravatar imagefafafafa ( 2020-12-09 08:47:33 -0500 )edit

Can't find dependent libraries

means, you have built that dynamically linked , so it depends on other opencv dll's (opencv_core450.dll, opencv_imgproc450, etc) at runtime

please add the location of the opencv library dlls tp the PATH env variable

berak gravatar imageberak ( 2020-12-09 11:41:00 -0500 )edit

@berak thanks man !! for helping me in each step! all problems are resolved ! and opencv is working successfully

fafafafa gravatar imagefafafafa ( 2020-12-10 10:33:55 -0500 )edit