# mencoder compilation failed



## assumer (Apr 28, 2011)

Hello all!  New to FreeBSD; I've had it installed a week now and have been able to get gnome and kde running using xinerama, and am loving the whole "ports" system.

But I am now stuck trying to install mencoder.

Here is what happens:

```
# portmaster multimedia/mencoder
...
cc -MD -MP -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls 
-Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign 
-Wdeclaration-after-statement -std=gnu99  -O4 -march=x86-64 -mtune=generic -pipe 
-ffast-math -fomit-frame-pointer
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -Ilibdvdread4 -I. 
-Iffmpeg  -I/usr/local/include  -I/usr/local/include  -I/usr/local/include/freetype2
-I/usr/local/include -DFF_API_MAX_STREAMS=0 -c -o m_option.o m_option.c

In file included from libmpdemux/demuxer.h:29,
                 from libmpdemux/aviheader.h:27,
                 from codec-cfg.c:57:
./sub/ass_mp.h:31:21: error: ass/ass.h: No such file or directory
In file included from libmpdemux/demuxer.h:29,
                 from libmpdemux/aviheader.h:27,
                 from codec-cfg.c:57:
./sub/ass_mp.h:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
./sub/ass_mp.h:48: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
...(a whole bunch more ass_mp.h errors)
```

I haven't modified any of the config options or anything like that.  Any thoughts on helping a newbie out?

Thanks in advance.


----------



## UNIXgod (Apr 28, 2011)

Install mplayer first.

That's where the missing header file comes from


----------



## SirDice (Apr 28, 2011)

UNIXgod said:
			
		

> install mplayer first.
> 
> That's where the missing header file comes from



This shouldn't be needed. Mencoder and MPlayer are so much alike they even share the same port Makefile.

@assumer, what version of mencoder are you trying to build? Did you update your ports tree?


----------



## assumer (Apr 28, 2011)

Hi, yes my ports tree was updated (did a *portsnap fetch update*).  I'm on my work computer right now but I believe it was version 20110329.  I tried installing mplayer, but it automatically tried to install both together, so I know that's not the issue.


----------



## SirDice (Apr 28, 2011)

I just build version 1.0.r20110329 and that went without any issues.


----------



## assumer (Apr 28, 2011)

*More data?*



			
				SirDice said:
			
		

> I just build version 1.0.r20110329 and that went without any issues.



Hmmm is there any information I could supply, or any other ports I could rebuild, or any config options I could set, which would help diagnose my problem?


----------



## SirDice (Apr 28, 2011)

Do you have any CFLAGS or similar in /etc/make.conf? If so, remove them and try again.


----------



## assumer (Apr 28, 2011)

SirDice said:
			
		

> Do you have any CFLAGS or similar in /etc/make.conf? If so, remove them and try again.



I just removed everything in /etc/make.conf and the same error comes up regarding ass.h.


----------



## assumer (Apr 28, 2011)

I found the problem...

The problem was during make, this line:


```
cc -O -DCODECS2HTML -I. -Iffmpeg -o codec-cfg codec-cfg.c
```
 gave the error.

So I went into the work/mplayer-export-2011-03-29 directory, and ran:


```
cc -O -DCODECS2HTML -I/usr/local/include -I. -Iffmpeg -o codec-cfg codec-cfg.c
```

and then code-cfg.c compiled.  I ran *make* again and then *make install* and it finished.  Wow!  Why was this necessary?  What went wrong?  Why wasn't /usr/local/include included by default?

This seems a bit ridiculous...did I miss something that screwed this up?


----------



## SirDice (Apr 29, 2011)

Yes, that is odd and shouldn't be needed. As I said, I build the port without any issues. Not sure why yours failed this way.


----------



## vwbusguy (May 14, 2011)

I can also verify this. Assumer's workaround worked for me.


----------



## vsoto (Jun 27, 2011)

*In case someone is wondering.*

Seems like it fails when multimedia/libass (which is required by vlc but not mplayer/mencoder) is installed.

From sub/ass_mp.h (in the port's build directory):


```
#if defined(CONFIG_ASS_INTERNAL) || !defined(CONFIG_ASS)
#include "libass/ass.h"
#else
#include <ass/ass.h>
#endif
```

If multimedia/libass is not installed libass/ass.h (in the build directory) is used and it succeeds. If it is installed it fails because -I/use/local/include is missing from the command:

```
cc -O -DCODECS2HTML -I. -Iffmpeg -o codec-cfg codec-cfg.c
```

Should be easy to fix, I think.


----------

