Unable to compile MPlayer on QNX

Hi,

I am getting following compiler errors when I comile MPlayer (MPlayer-1.0rc) source code on QNX 6.3.2 OS.

utils.c:495: initializer element is not constant
utils.c:495: (near initialization for options[63].min') utils.c:495: initializer element is not constant utils.c:495: (near initialization for options[63].max’)
utils.c:496: initializer element is not constant
utils.c:496: (near initialization for options[64].min') utils.c:496: initializer element is not constant utils.c:496: (near initialization for options[64].max’)
utils.c:501: initializer element is not constant
utils.c:501: (near initialization for options[69].min') utils.c:501: initializer element is not constant utils.c:501: (near initialization for options[69].max’)
utils.c:543: initializer element is not constant
utils.c:543: (near initialization for options[109].min') utils.c:543: initializer element is not constant utils.c:543: (near initialization for options[109].max’)
utils.c:556: initializer element is not constant
utils.c:556: (near initialization for options[122].min') utils.c:556: initializer element is not constant utils.c:556: (near initialization for options[122].max’)
utils.c:563: initializer element is not constant
utils.c:563: (near initialization for options[129].min') utils.c:563: initializer element is not constant utils.c:563: (near initialization for options[129].max’)
utils.c:564: initializer element is not constant
utils.c:564: (near initialization for options[130].min') utils.c:564: initializer element is not constant utils.c:564: (near initialization for options[130].max’)
utils.c:565: initializer element is not constant
utils.c:565: (near initialization for options[131].min') utils.c:565: initializer element is not constant utils.c:565: (near initialization for options[131].max’)
utils.c:566: initializer element is not constant
utils.c:566: (near initialization for options[132].min') utils.c:566: initializer element is not constant utils.c:566: (near initialization for options[132].max’)
utils.c:575: initializer element is not constant
utils.c:575: (near initialization for options[141].min') utils.c:575: initializer element is not constant utils.c:575: (near initialization for options[141].max’)
utils.c:576: initializer element is not constant
utils.c:576: (near initialization for options[142].min') utils.c:576: initializer element is not constant utils.c:576: (near initialization for options[142].max’)
utils.c:577: initializer element is not constant
utils.c:577: (near initialization for options[143].min') utils.c:577: initializer element is not constant utils.c:577: (near initialization for options[143].max’)
utils.c:578: initializer element is not constant
utils.c:578: (near initialization for options[144].min') utils.c:578: initializer element is not constant utils.c:578: (near initialization for options[144].max’)
utils.c:579: initializer element is not constant
utils.c:579: (near initialization for options[145].min') utils.c:579: initializer element is not constant utils.c:579: (near initialization for options[145].max’)
utils.c:712: initializer element is not constant
utils.c:712: (near initialization for options[276].min') utils.c:712: initializer element is not constant utils.c:712: (near initialization for options[276].max’)
utils.c:734: initializer element is not constant
utils.c:734: (near initialization for options[298].min') utils.c:734: initializer element is not constant utils.c:734: (near initialization for options[298].max’)
make[1]: *** [utils.o] Error 1
make[1]: Leaving directory `/home/govind/govind/players/MPLAYER/MPlayer-1.0rc2/libavcodec’
make: *** [libavcodec/libavcodec.a] Error 2

I looked in to the code and the initializer element is an constant defined in float.h as FLT_MIN and FLT_MAX.

Why is this error is coming even though it is defined as constant in float.h.

Did any one compiled MPlayer on QNX ???

Thanks,
Govind.

Check this out. Looks like someone had a similar problem:
opentom.org/Build_MPlayer

he is also facing build issues.

I`m compiling MPlayer-1.0rc2 and mplayer-export-2008-07-16 without any problems.
./configure =>
Detected operating system: QNX
Detected host architecture: i386
Checking for gcc version … 4.4.0
Checking for host cc … gcc
Checking for cross compilation … no
Checking for CPU vendor … GenuineIntel (6:15:11)
Checking for CPU type … Intel(R) Core™2 Quad CPU Q6600 @ 2.40GHz
Checking for kernel support of mmx … yes
Checking for kernel support of mmxext … yes
Checking for kernel support of sse … yes
Checking for kernel support of sse2 … yes
Checking for kernel support of ssse3 … yes
Checking for kernel support of cmov … yes
Checking for mtrr support … yes
Checking for GCC & CPU optimization abilities … native
Checking for extern symbol prefix …
Checking for assembler support of -pipe option … yes
Checking for compiler support of named assembler arguments … yes
Checking for assembler (/usr/qnx632/host/qnx6/x86/usr/bin/ntox86-as-2.17 2.17) … ok
Checking for .align is a power of two … no
Checking for -lposix … no
Checking for -lm … yes
Checking for langinfo … no
Checking for language … using en (man pages: en )
Checking for enable sighandler … yes
Checking for runtime cpudetection … no
Checking for restrict keyword … __restrict
Checking for __builtin_expect … yes
Checking for kstat … no

Checking for lircc … no
Checking for DVD support (libdvdnav) … no
Creating config.mak
Creating config.h

Config files successfully generated by ./configure !

Install prefix: /usr/local
Data directory: /usr/local/share/mplayer
Config direct.: /usr/local/etc/mplayer

Byte order: little-endian
Optimizing for: native

Languages:
Messages/GUI: en
Manual pages: en

Enabled optional drivers:
Input: ftp tv dvdread(external) vcd network
Codecs: libavcodec xanim faad2 libmpeg2 liba52 mp3lib tremor(internal)
Audio output: alsa5 mpegpes(file)
Video output: pnm mpegpes(file) opengl dga xv x11 xover yuv4mpeg md5sum tga
Disabled optional drivers:
Input: dvdnav vstream pvr radio tv-teletext tv-v4l2 tv-v4l1 tv-dshow live555 nemesi cddb cdda libdvdcss(in
ternal) dvb smb
Codecs: x264 xvid libdv libamr_wb libamr_nb qtx real win32 faac musepack libdca libtheora speex toolame tw
olame libmad liblzo gif
Audio output: sun openal jack pulse esd arts oss v4l2 ivtv dxr2 nas sdl
Video output: zr zr2 v4l2 ivtv dxr3 dxr2 sdl vesa gif89a jpeg png fbdev svga caca aa ggi xmga mga xvidix w
invidix cvidix 3dfx xvmc dfbmga directfb bl xvr100 tdfx_vid s3fb tdfxfb

‘config.h’ and ‘config.mak’ contain your configuration options.
Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
compile *** DO NOT REPORT BUGS if you tweak these files ***

‘make’ will now compile MPlayer and ‘make install’ will install it.

compiling utils.c:
gcc -MM -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -I… -I… -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99 -I. -Wall -Wno-switch -Wpointer-arith
-Wredundant-decls -O4 -march=native -mtune=native -pipe -ffast-math -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -I/usr/X11R6/include utils.c | sed “s,[0-9a-z._-]: (/libavformat/)([a-z0-9]/)[^/] ,\2&,” > utils.d
and
gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -I… -I… -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99 -I. -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=native -mtune=native -pipe -ffast-math -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -I/usr/X11R6/include -c -o utils.o utils.c
utils.c:36: warning: ‘AVFrac’ is deprecated
utils.c:37: warning: ‘AVFrac’ is deprecated
utils.c: In function ‘match_ext’:
utils.c:91: warning: implicit declaration of function ‘strcasecmp’
utils.c: At top level:
utils.c:3176: warning: ‘AVFrac’ is deprecated
utils.c:3194: warning: ‘AVFrac’ is deprecated
utils.c: In function ‘av_seek_frame_binary’:
utils.c:1230: warning: ‘pos_min’ may be used uninitialized in this function
utils.c:1230: warning: ‘pos_max’ may be used uninitialized in this function

cd /src/MPlayer/mplayer

ls -l | grep mplayer

-rwxrwxr-x 1 root root 8490885 Jul 16 19:42 mplayer

ldd mplayer

./mplayer:
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0xb8200000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0xb820d000)
libXv.so.1 => /usr/X11R6/lib/libXv.so.1 (0xb82eb000)
libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0xb82f0000)
libXxf86vm.so.1 => /usr/X11R6/lib/libXxf86vm.so.1 (0xb82f3000)
libXxf86dga.so.1 => /usr/X11R6/lib/libXxf86dga.so.1 (0xb82f8000)
libGL.so.1 => /usr/X11R6/lib/libGL.so.1 (0xb82fd000)
libph.so.3 => /usr/lib/libph.so.3 (0xb835b000)
libsocket.so.2 => /lib/libsocket.so.2 (0xb845b000)
libasound.so.2 => /lib/libasound.so.2 (0xb847f000)
libm.so.2 => /lib/libm.so.2 (0xb8492000)
libfont.so.1 => /lib/libfont.so.1 (0xb84ae000)
libc.so.2 => /usr/lib/ldqnx.so.2 (0xb0300000)

./mplayer

MPlayer dev-SVN-rUNKNOWN-4.4.0 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Core™2 Quad CPU Q6600 @ 2.40GHz (Family: 6, Model: 15, Stepping: 11)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
115 audio & 237 video codecs
Usage: mplayer [options] [url|path/]filename

Here is what I had to do to build this

Use qcc to compile, it will call gcc for you. This is how I called configure :

CC=‘qcc -Vgcc_ntox86’ CXX=‘qcc -Vgcc_ntox86’ ./configure --disable-gcc-check --disable-tv --disable-mmx --disable-mmxext --disable-sse

You may also want to use gcc 3.3.5 as your default compiler, QNX by default uses 2.95.3. On self hosted you will need to edit this file to look like this

cat /usr/qnx632/host/qnx6/x86/etc/qcc/default

DIR=gcc/3.3.5/

Then I found there was something wrong with “tr” that caused a configure issue. So in configure I had to changed the lines in this section to replace “\n” with “\12” before you run configure.

echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'

to

echo $_libavdecoders | tr '[a-z] ' '[A-Z]\12' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavencoders | tr '[a-z] ' '[A-Z]\12' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavparsers | tr '[a-z] ' '[A-Z]\12' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\12' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavmuxers | tr '[a-z] ' '[A-Z]\12' | sed 's/^/CONFIG_/;s/$/=yes/'
echo $_libavbsfs | tr '[a-z] ' '[A-Z]\12' | sed 's/^/CONFIG_/;s/$/=yes/'

And in the utils.c file you are having trouble with I just hardcoded the values since I think there is some strangeness between float.h and limits.h. Rather then figure it I added this near the top

#ifdef QNXNTO
#define FLT_EPSILON 0x8p-26
#define FLT_MAX 3.402823466e+38f
#define FLT_MIN 0x8p-129
#endif

And one last issue. In libavcodec/cabac.h around line 385 I had to hardcode undefine HAVE_EBX_AVAILABLE, maybe there was a config option but I was getting lazy at this point.

#ifdef QNXNTO
#undef HAVE_EBX_AVAILABLE
#endif

#if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS)

After this it built. I used SDL to run it, you’ll need to install and configure that. If you want SDL to be recognized by MPlayer’s configure you’ll need to edit /usr/local/bin/sdl-config file so the lib lines look like this

--libs)
  echo -L${exec_prefix}/lib  -lSDL -lph -lasound
  ;;
--static-libs)

–libs|–static-libs)

  echo -L${exec_prefix}/lib  -lSDL -lph -lasound

I think that’s everything??? hopefully :slight_smile:

Regards
Jason
www.cranksoftware.com

That’s really awesome. Someone want to make a .qpr out of it?

I don`t use .qpr only *.tgz
In my version with X11 and XPhoton mplayer working well.
I compiling SDL-1.2.13. Test programs work well.
When I try mplayer with SDL in full screen mode it not work.
Error is:
VO: [sdl] 592x320 => 592x320 Planar YV12
[VO_SDL] Set_fullmode: SDL_SetVideoMode failed: ph_SetupFullScreenImage(): PdCreateOffscreenContext(back) func
tion failed !
.
[VO_SDL] Failed to set video mode: ph_SetupFullScreenImage(): PdCreateOffscreenContext(back) function failed !
.
FATAL: Cannot initialize video driver.

I found mplayer to wonky full screen anyway. Windowed always worked for me.

And .tgz would work if you want to package it up. I can test it if you want.

OK.
Go to ajam.org.pl/
I send SDL version.

I am getting a strange error:

mplayer -vo X11 test.mov unknown symbol: __moddi3 Could not resolve all symbols

No matter how I invoke mplayer, thats the error I get.

This version I compiling without X11.

ldd mplayer

./mplayer:
libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0xb8200000)
libph.so.3 => /usr/lib/libph.so.3 (0xb824c000)
libsocket.so.2 => /lib/libsocket.so.2 (0xb834c000)
libasound.so.2 => /lib/libasound.so.2 (0xb8370000)
libz.so.1 => /usr/lib/libz.so.1 (0xb8383000)
libm.so.2 => /lib/libm.so.2 (0xb8397000)
libfont.so.1 => /lib/libfont.so.1 (0xb83b3000)
libc.so.2 => /usr/lib/ldqnx.so.2 (0xb0300000)

Tray on your computer ldd mplayer and send result

ldd mplayer

./mplayer:
libSDL-1.2.so.0 => /opt/lib/libSDL-1.2.so.0 (0xb8200000)
libph.so.3 => /usr/lib/libph.so.3 (0xb823e000)
libsocket.so.2 => /lib/libsocket.so.2 (0xb833e000)
libasound.so.2 => /lib/libasound.so.2 (0xb8362000)
libz.so.1 => /usr/lib/libz.so.1 (0xb035e000)
libm.so.2 => /lib/libm.so.2 (0xb8375000)
libph.so.2 => /usr/lib/libph.so.2 (0xb8391000)
libGL.so.2 => /opt/lib/libGL.so.2 (0xb848b000)
libfont.so.1 => /lib/libfont.so.1 (0xb848e000)
libc.so.1 => /lib/libc.so.1 (0xb036b000)
libphrenderGL.so.2 => /opt/lib/libphrenderGL.so.2 (0xb8499000)
libglide2x.so.2 => /opt/lib/libglide2x.so.2 (0xb03b9000)
libphrender.so.2 => /usr/lib/libphrender.so.2 (0xb8645000)
libc.so.2 => /usr/lib/ldqnx.so.2 (0xb0300000)

Do you test my version of mplayer or your ?
I compiled without the use of GL because I do not have him.
What version QNX do you use ? Do you work on what CPU ?
What does mplayer -vo help ?

I am using your version of Mplayer. I use QNX 6.3.2 on Intel x86.
Running mplayer -vo gives me the same error.

OK look

nm -f sysv -u -A -s mplayer | grep __moddi3

mplayer:__moddi3 | | U | FUNC|000001b9| |UND

__moddi3 is unknown symbol in mplayer.
But

readelf -d mplayer

Dynamic section at offset 0x649364 contains 26 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libSDL-1.2.so.0]
0x00000001 (NEEDED) Shared library: [libph.so.3]
0x00000001 (NEEDED) Shared library: [libsocket.so.2]
0x00000001 (NEEDED) Shared library: [libasound.so.2]
0x00000001 (NEEDED) Shared library: [libz.so.1]
0x00000001 (NEEDED) Shared library: [libm.so.2]
0x00000001 (NEEDED) Shared library: [libc.so.2]
0x0000000c (INIT) 0x804a894
0x0000000d (FINI) 0x8596de0

And in libSDL-1.2.so.0

nm -f sysv -A -s libSDL-1.2.so.0 | grep __moddi3

libSDL-1.2.so.0:__moddi3 |0003f798| T | FUNC|000001b9| |.text

__moddi3 is defined in libSDL-1.2.so.0 and in my system mplayer work.
To compile mplayer and SDL I use gcc4.4.0

Did you compile sdl yourself or use the QNX packages? If you compiled it yourself, that is probably my problem because I had the QNX packages installed. I’ll go ahead and try compiling sdl myself.

I have installed my own SDL and libtool. Still the same error. I give up.

I do not use QNX packages. I compile whole software use gcc 4.3 and gcc4.4.
I send SDL-1.2 to ajam.org.pl/
This will help maybe.

Your SDL did it! Now it works fine.
Thank you for your help and patience. I appreciate it.
Now I can watch videos while doing some porting :slight_smile:

this Mplayer ,What codec support. mpeg1 or mpeg2 ,avi … ?