Tag Archives: Compiling Errors

Since the release of the latest x264 versions (in my case 20081012-2245), there have been some problems compiling MPlayer with x264 support. These problems express themselves in these error messages:

libx264.c: In function ‘X264_init’:
libx264.c:165: error: ‘x264_param_t’ has no member named ‘b_bframe_adaptive’
libx264.c:228: error: ’struct <anonymous>’ has no member named ‘b_bidir_me’
libx264.c:229: error: ’struct <anonymous>’ has no member named ‘b_bframe_rdo’
libx264.c:254: error: ’struct <anonymous>’ has no member named ‘psz_rc_eq’
make[1]: *** [libx264.o] Error 1

These problems stem from the latest versions having some members of a struct renamed. There is a thread on mplayer-devel concerning exactly this problem, but sadly the patch doesn’t seem to go far enough since I still get some compiler errors even after applying the patch (the first error goes away, the others stay – figures). Therefore I scurried around the interwebs a bit and found this thread on gentoo bugzilla, which supplies a working patch.

At this point some of you may actually be wondering how to apply one of these patch files – Simply place the patch file in your mplayer root folder (where the configure script is and so on), open your console, change to the mplayer root directory, and type in:

patch -p0 < patchname

So if your patch file is named “ff.patch”, type in:

patch -p0 < ff.patch

Now if you have used the second patch you may have noticed that the patch program says that it cant find the file to patch. This is normal since patch assumes the file is in another directory altogether, which you can see by looking at the patch file with a normal text editor. When asked which file to patch type in:

libavcodec/libx264.c

After that you can simply resume by running make again. Happy compiling.

I wanted to get some good old Dos-action using Linux, specifically OpenSuse 11.0. Since Dosbox didn’t offer an RPM for my distro, I felt compelled to compile DosBox from the source, but, as always, compiling has its own share of problems. This will be a guide for people who already have the requisite basis on which to compile programs (C++ compiler + make) and know how to use a terminal. But I think this will also help more advanced users with some errors, which, if you don’t know a bit of C/C++, will cause some wonderment and probably disdain. In any case, before you download the source, you should install sdl-devel, it will be required by DosBox and was probably not installed using the normal installation settings of Suse, even with C++ dev packages installed.

Download the source, and extract it into any folder. Now open your terminal, change to the main directory of the dosbox source, and type in

./configure

You should not get any error messages yet. If you do, you probably need to install some missing libraries, just search for them using the Yast software-installation-module and install. After installing missing libraries don’t forget to run configure again, to see if everything is set!

After you ran configure and everything seems fine, type in

make

This is where the problems appear, at least for me on my system.

First of I got a “memset was not declared in this scope”-error message in gameblaster.cpp. To remedy this I simply included string.h to the header files of gameblaster.cpp, which is located in src/hardware. So simply add

#include <string.h>

to the top of the file using any program you like.

The result should look something like this:

Go back in the main DosBox directory, type in make again. After a while an error in tandysound.cpp, also in the src/hardware folder, appears, stating that this time strcmp was not defined in scope. I thought that the “str” prefix probably refers to string, so I simply added string.h to tandysound.cpp again, and you should do the same, of course! Problem solved.

Get back to the main directory and run make again. I got the last error message, saying that “atoi” was not in scope in shell_cmds.cpp, located in the src/shell directory. I didn’t really know what atoi was, but after some searching on the internets, i found out it was defined in cstdlib.

So I again appended it to the top of the file using:

#include <cstdlib>

Note that the name is cstdlib, not cstdlib.h. Afterwards I ran make again, and voila, the DosBox executable appeared in the src folder and the kingdom was saved.

Hope I helped someone, if not, well, then I’ve wasted my time! Hey, at least I admit it!