Msys2-Mingw64 OpenCV Build Error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Msys2-Mingw64 OpenCV Build Error

Max Ashton
Hi guys,

I'm using MSys2 with Mingw64 to compile FFMpeg 3.3.3 with opencv enabled.  I have installed opencv version 3.2.0-7 using pacman -S mingw-w64-x86_64-opencv but get the following error when I try to ./configure --enable-libopencv

gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -std=c11 -fomit-frame-pointer -mms-bitfields -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/freetype2 -IC:/msys64/mingw64/include/libpng16 -IC:/msys64/mingw64/include/harfbuzz -IC:/msys64/mingw64/include/glib-2.0 -IC:/msys64/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/fribidi -IC:/msys64/mingw64/include/freetype2 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/libpng16 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/harfbuzz -IC:/msys64/mingw64/include/glib-2.0 -IC:/msys64/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include -mms-bitfields -IC:/msys64/mingw64/include/freetype2 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/libpng16 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/harfbuzz -IC:/msys64/mingw64/include/glib-2.0 -IC:/msys64/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include -c -o /tmp/ffconf.INsGNY2h/test.o /tmp/ffconf.INsGNY2h/test.c
C:/msys64/tmp/ffconf.INsGNY2h/test.c: In function 'check_cvCreateImageHeader':
C:/msys64/tmp/ffconf.INsGNY2h/test.c:3:47: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
long check_cvCreateImageHeader(void) { return (long) cvCreateImageHeader; }
                                               ^
gcc -Wl,--nxcompat,--dynamicbase -Wl,--high-entropy-va -Wl,--as-needed -Wl,--image-base,0x140000000 -o /tmp/ffconf.INsGNY2h/test.exe /tmp/ffconf.INsGNY2h/test.o -lopencv_core -lopencv_imgproc -lmp3lame -LC:/msys64/mingw64/lib -lfreetype -LC:/msys64/mingw64/lib -lfdk-aac -LC:/msys64/mingw64/lib -lass -lm -llzma -lbz2 -lz -lpsapi -ladvapi32 -lshell32 -lole32
C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x5fc): undefined reference to `cvRound'
C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x5fc): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `cvRound'
C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x60f): undefined reference to `cvRound'
C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x60f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `cvRound'
C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0xfa9): undefined reference to `cvRound'
C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0xfa9): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `cvRound'


Looking though the opencv 3.2 documentation it appears that cvRound has been dropped? As I find it in the 2.4 documentation but not the 3.2.

Does anyone have any suggestions on how I might fix this issue, without the need to fall back to opencv 2.4.

Thanks in advanced,

Kind Regards
Max
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Msys2-Mingw64 OpenCV Build Error

Moritz Barsnick
On Tue, Sep 12, 2017 at 12:52:57 +0000, Max Ashton wrote:

> Looking though the opencv 3.2 documentation it appears that cvRound
> has been dropped? As I find it in the 2.4 documentation but not the
> 3.2.

I can find it:
http://docs.opencv.org/3.3.0/db/de0/group__core__utils.html
http://docs.opencv.org/3.3.0/db/de0/group__core__utils.html#ga085eca238176984a0b72df2818598d85

> gcc -Wl,--nxcompat,--dynamicbase -Wl,--high-entropy-va -Wl,--as-needed -Wl,--image-base,0x140000000 -o /tmp/ffconf.INsGNY2h/test.exe /tmp/ffconf.INsGNY2h/test.o -lopencv_core -lopencv_imgproc -lmp3lame -LC:/msys64/mingw64/lib -lfreetype -LC:/msys64/mingw64/lib -lfdk-aac -LC:/msys64/mingw64/lib -lass -lm -llzma -lbz2 -lz -lpsapi -ladvapi32 -lshell32 -lole32
> C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x5fc): undefined reference to `cvRound'
> C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x5fc): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `cvRound'

I don't know much about MinGW(64) and MSys, but on Linux, this would
have looked like a 32 vs. 64 bit compilation/linking issue. Do the libs
you have downloaded with pacman correspond to the target you are
compiling your ffmpeg for? (Yes, I do see there's a "64" everywhere in
the paths - just wondering.)

*Shrug*
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Msys2-Mingw64 OpenCV Build Error

Max Ashton
Thanks for the response Mortiz,

Don't know how I missed that.

They were compiled with mingw64 so I'd say it's safe to assume opencv is 64 bit.

Max

-----Original Message-----
From: ffmpeg-user [mailto:[hidden email]] On Behalf Of Moritz Barsnick
Sent: 12 September 2017 15:30
To: FFmpeg user discussions <[hidden email]>
Subject: Re: [FFmpeg-user] Msys2-Mingw64 OpenCV Build Error

On Tue, Sep 12, 2017 at 12:52:57 +0000, Max Ashton wrote:

> Looking though the opencv 3.2 documentation it appears that cvRound
> has been dropped? As I find it in the 2.4 documentation but not the
> 3.2.

I can find it:
http://docs.opencv.org/3.3.0/db/de0/group__core__utils.html
http://docs.opencv.org/3.3.0/db/de0/group__core__utils.html#ga085eca238176984a0b72df2818598d85

> gcc -Wl,--nxcompat,--dynamicbase -Wl,--high-entropy-va -Wl,--as-needed
> -Wl,--image-base,0x140000000 -o /tmp/ffconf.INsGNY2h/test.exe
> /tmp/ffconf.INsGNY2h/test.o -lopencv_core -lopencv_imgproc -lmp3lame
> -LC:/msys64/mingw64/lib -lfreetype -LC:/msys64/mingw64/lib -lfdk-aac
> -LC:/msys64/mingw64/lib -lass -lm -llzma -lbz2 -lz -lpsapi -ladvapi32
> -lshell32 -lole32
> C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x5fc): undefined reference to `cvRound'
> C:/msys64/tmp/ffconf.INsGNY2h/test.o:test.c:(.text+0x5fc): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `cvRound'

I don't know much about MinGW(64) and MSys, but on Linux, this would have looked like a 32 vs. 64 bit compilation/linking issue. Do the libs you have downloaded with pacman correspond to the target you are compiling your ffmpeg for? (Yes, I do see there's a "64" everywhere in the paths - just wondering.)

*Shrug*
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".