What's new

Compile Failure under Ubuntu Edgy

mojo

New member
Hi there,
The system is Ubuntu Edgy. I was mucking around trying to compile Mupen64 yesterday. The 'configure' script outputs errors when I tried to run it:

Code:
mojo@mojo:~/Desktop/mupen64_src-0.5$ ./configure --prefix='/usr'
Found a working C compiler (gcc).
Checking SDL...
./config.temp: 3: Syntax error: "(" unexpected
*** Couldn't find a working SDL library!

Well, it doesn't make some sense to me at all since I have installed dev package of 'libsdl1.2-dev' and 'libsdl-ttf2.0-dev'. Can anyone point out what's wrong here?

However, w/o running 'configure' script, I still could compile the program running 'make'. But stuck at this error:

Code:
mojo@mojo:~/Desktop/mupen64_src-0.5$ make
gcc -DX86 -O3 -fexpensive-optimizations -fomit-frame-pointer -funroll-loops -ffast-math -fno-strict-aliasing -mcpu=athlon -Wall -pipe `freetype-config --cflags` `sdl-config --cflags` -c -o blight_input/SDL_ttf.o blight_input/SDL_ttf.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
blight_input/SDL_ttf.c:51:38: error: freetype/internal/ftobjs.h: No such file or directory
blight_input/SDL_ttf.c: In function ‘TTF_OpenFontIndexRW’:
blight_input/SDL_ttf.c:278: error: dereferencing pointer to incomplete type
make: *** [blight_input/SDL_ttf.o] Error 1

Did I miss some dev packages required? It'd be nice if the team can list me required packages to compile the program. Thanks.
 

CF2

Pretends to make sense
I think mupen64 is simply broken on newer distributions. I tried this a few days ago and came up with the same error. You could try the binary version, but that always exits on signal 11 whenever I try to run a game. I've heard this is due to a change in the kernel, so there probably isn't much we can do.
 

Hacktarux

Emulator Developer
Moderator
I have added this to my todo list. I know i have to rewrite the compilation process.

Anyway, the quick solution to fix it now is to search ftbobjs.h file, if you can't find it, install freetype on your system. If you find it, then modofy the SDL_ttf.c file in mupen64 source code by changing the path to ftobjs.h.

In the future, i think i'll try to remove the freetype dependency.
 

BRP

That guy
I had this problem, it was because the compile was actually failing when it tested for SDL. A fix? Ehhh... go to the line where it says:

echo "int main(void) { if (SDL_Init( 0 ) < 0) { printf( \"SDL_Init(): %s\\n\", SDL_GetError() ); return 1; } return 0; }" >> "$FILE"

and change the "void" to "int argc, char *argv[]". I've seen this problem once in a while lately, but never actually caused the problem myself (because I always use argc and argv). I think that should take care of it, but I'm testing all this on a mac where the GTK tests don't work if you aren't using X11, so I could be mistaken....

hacktarux: any chance you could be convinced to use autotools for your script?
 

sq377

New member
For me,
This is what line 148 said:
Code:
echo "int main(void) { if (SDL_Init( 0 ) < 0) { printf( \"SDL_Init(): %s\\n\", SDL_GetError() ); return 1; }

This is what it should say
Code:
echo "int main(void) { if (SDL_Init( 0 ) < 0) { printf( \"SDL_Init(): %s\\\\n\", SDL_GetError() ); return 1; }

2 slashes.
 
OP
mojo

mojo

New member
sq377: Genius! What a bad typo, now 'configure' works still remain the SDL_ttf issue, well at least I make it compile by following Hacktarux instruction.
 

BRP

That guy
I'd find it rather odd if that should be the solution. I mean, if it works, that's all fine and well, but the problem was originally that the compile failed. The idea is to compile a C file that looks like this:
Code:
#include "SDL.h"
#include <stdio.h>
int main(int argc, char *argv[]) { if (SDL_Init( 0 ) < 0) { printf( "SD
L_Init(): %s\n", SDL_GetError() ); return 1; } return 0; }
Adding another backslash to that C file should do pretty much nothing, since the program's output isn't checked, and it only shows up if you get an error. The reason you get the '(' error is because it failed to compile and it tries to run the C program as a shell script. A reason it can fail to compile is because you use main(void) instead of main(int argc, char *argv[]) (and don't ask me why that is with SDL, it wasn't my big idea!).

There is the off chance that it could have to do with proper formatting of the C output code, but I doubt it.
 

sh00

New member
Here's a patch with some fixes (including the SDL_ttf problem).
Copy it to the mupen directory and type:

zcat mupenpatch3.diff.gz | patch -p1
 

GarulfoLinux

New member
Here's a patch with some fixes (including the SDL_ttf problem).
Copy it to the mupen directory and type:

zcat mupenpatch3.diff.gz | patch -p1

your patch not works with me. I've same issue :
Code:
Checking SDL...
./config.temp: 3: Syntax error: "(" unexpected
*** Couldn't find a working SDL library!
 

mherbert0

New member
sh00's patch worked for me. It fixed my SDL_ttf compile problems atleast, but it failed to apply to main.c (probably because I had applied greyhammer's command line patch already)

Anyway, hopefully we'll get an updated version soon, it'd be nice to have a compile-able version for current linux releases.

Hacktarux, if you're looking for any help moving over to an autoconf system, I'd be more than happy to pitch some code your way. I'd even be willing to build FC6 RPM's, if somebody has a good place to host them.

-Matt
 

Top