[MEncoder-users] Compiling in Windows

James Hastings-Trew jimht at shaw.ca
Sat Feb 14 16:33:43 CET 2009


Reimar Döffinger wrote:
> On Sat, Feb 14, 2009 at 08:53:19AM -0600, James Hastings-Trew wrote:
>   
>> It's been said in this list before that you'd have to be an idiot if you 
>> can't compile Mplayer and Mencoder from source. Therefore, I am an 
>> idiot.
>>     
>
> I hope I never used the word "idiot", even if on some days I think it
> (and I hope you will forgive me my unfriendly thoughts :-) ).
> Anyway, on Windows compiling unfortunately is a somewhat advanced topic,
> particularly if you want it to actually work well.
> Which is why most people should just use some binary, for Windows even
> up-to-date ones are not that hard to get.
>
>   
>> I noticed as configure was running the following message go by:
>>         Checking for x264 ... no (in libavcodec: no)
>> And looking in configure.log I saw this:
>>     
>
> I'd say you're not bad at compiling stuff :-)
>
>   
>> #include <inttypes.h>
>> #include <x264.h>
>> #if X264_BUILD < 59
>> #error We do not support old versions of x264. Get the latest from SVN.
>> #endif
>> int main(void) { x264_encoder_open((void*)0); return 0; }
>>
>> gcc -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 
>> -march=native -mtune=native -pipe -ffast-math -fomit-frame-pointer -I.  
>> -Ilibdvdread4   -lwinmm -lws2_32 -liconv -lpng -lz -ljpeg -lgif -lz 
>> -lbz2 -lmad -lspeex -ldts -lmpcdec -ladvapi32 -lole32 -lxvidcore -lm  
>> -lopengl32 -lgdi32 -lgdi32 -lwinmm -ld3d9 -lgdi32 -lfaac  -lfaac -o 
>> /tmp/mplayer-conf-8512-1648.exe /tmp/mplayer-conf-29628-1648.c -lx264
>> c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(encoder.o):(.text+0x2243): 
>> undefined reference to `pthread_join'
>>     
>
> What you missed is the reason why these failed: configure did not
> find a pthread library, so look for that check and find out why it
> failed.
>
>   
>> Looking in the various MinGW folders, I do indeed have bin/x264.exe, 
>> include/x264.h, and lib/libx264.a, so I am reasonably confident that I 
>> have the various x264 bits that the compiler is looking for but 
>> something about the pthread thing is not right. :(
>>     
>
> Well, getting and linking against a libx264.dll if such a thing exists
> might work at well, but performance might be somewhat worse.
>
>   
>> Buh... so, what do I need to do to make this work? I have a sense that I 
>> am *this* close, but I am really at a loss as to what to do to fix this.
>>     
>
> See what the "pthread" check says in configure.log, and if that does not
> help you further give us the output of that.
>
> Greetings,
> Reimar Döffinger
> _______________________________________________
>   
I do have a includes/pthread.h and a lib/libpthreadGC2.a file in my 
setup, but examining the configure.log file I see this:

============ Checking for pthread ============

#include <pthread.h>
void* func(void *arg) { return arg; }
int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) 
== 0 ? 0 : 1; }

gcc -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 
-march=native -mtune=native -pipe -ffast-math -fomit-frame-pointer 
-I.    -lwinmm -lws2_32   -o /tmp/mplayer-conf-7739-3396.exe 
/tmp/mplayer-conf-2683-3396.c -lpthreadGC2
C:/DOCUME~1/James/LOCALS~1/Temp/ccfFHeL0.o:mplayer-conf-2683-3396.c:(.text+0x44): 
undefined reference to `_imp__pthread_create'
collect2: ld returned 1 exit status

and a bunch of variations on that...

I might just take your advice on getting pre-built binaries - it's what 
I've been doing so far, but Gianluigi's latest build is getting a bit 
long in the tooth ( 28311) and I was hoping to roll my own, a little 
fresher. Oh well.





More information about the MEncoder-users mailing list