Log in

View Full Version : [xvid_encraw] Trying to compile with MinGW


filler56789
21st October 2012, 03:35
Okay, I intend to compile xvid_encraw.exe, only because I'd like to increase the maximum quantity of zones from 64 to a more-reasonable value (256 or 512, for example). I've downloaded the modded Xvid 1.3.2 source-code from Jawor's site, and managed to build xvidcore.dll, however xvid_encraw gives me just the following error message:

$ make
gcc -g -DARCH_IS_IA32 -DARCH_IS_32BIT -DARCH_IS_LITTLE_ENDIAN -mno-cygwin -I../src -c xvid_enc raw.c

gcc -o xvid_encraw xvid_encraw.o -lc -lm ../build/generic/=build/xvidcore.a -lpthread d:/minimsys/zs4mingw/bin/../lib/gcc/i686-pc-mingw32/4.5.2/../../../../i686-pc-mingw32/bin/ld.exe: cannot find -lc

collect2: ld returned 1 exit status
make: *** [xvid_encraw] Error 1

Chikuzen
21st October 2012, 16:03
#!/bin/bash

HERE=$(cd $(dirname $0);pwd)
wget http://jawormat.republika.pl/Xvid_14-127_source.7z
7z x Xvid_14-127_source.7z
cd xvidcore/build/generic
./bootstrap.sh
CF="-Os -g0 -march=i686 -mfpmath=sse -msse2 -ffast-math -fomit-frame-pointer -fexcess-precision=fast"
CFLAGS="${CF}" ./configure --prefix="${HERE}"
make -j4 && make install
cd "${HERE}/xvidcore/examples"
gcc -c -DARCH_IS_32BIT -DARCH_IS_IA32 -DARCH_IS_LITTLE_ENDIAN -I${HERE}/xvidcore/src ${CF} -o xvid_encraw.o xvid_encraw.c
gcc -o ${HERE}/bin/xvid_encraw.exe -Wl,-s -Wl,--large-address-aware -L. xvid_encraw.o -avifil32 -L${HERE}/lib -lxvidcore -lpthread

:rolleyes:

filler56789
21st October 2012, 17:29
Does your "recipe" apply to Xvid 1.3.2 as well? :confused:

Chikuzen
21st October 2012, 17:59
About a year ago, I wrote some patches to compile xvidcore on mingw, and posted them to xvid ML.
(and they ware applied to svn repository)
Since some changes are needed for compiling it on mingw, I do not recommend 1.3.2.

Does your "recipe" apply to Xvid 1.3.2 as well?
No.
You ordered to link libc to the linker.
however, mingw doesn't have libc because it use msvcrt.dll as libc.
thus, never add -lc on mingw.

filler56789
21st October 2012, 18:51
You ordered to link libc to the linker.
however, mingw doesn't have libc because it use msvcrt.dll as libc.
thus, never add -lc on mingw.

:stupid:

But thanks for the complete answer. :thanks:

I will download the 1.4 code :( and will try once again. :o

filler56789
21st October 2012, 22:08
@ Chikuzen: many THANKS again, your command-lines work. :)


xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert

<SNIP>

NB: You can define 512 zones repeating the -z[qw] option as needed.

:D

Chikuzen
22nd October 2012, 02:30
sorry, I misunderstood your question.

about compiling xvid_encraw, my recipe is effective also to 1.3.2.