The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: Valaggar on February 24, 2007, 08:40:00 pm



Title: Compiling UQM with MinGW
Post by: Valaggar on February 24, 2007, 08:40:00 pm
http://koti.mbnet.fi/lonnberg/MinGWUQM.txt (http://koti.mbnet.fi/lonnberg/MinGWUQM.txt)
Following this instructions rigorously, I tried to compile UQM. MSYS acted like it compiled UQM, but I can't find a compiled UQM anywhere.
Help please!


Title: Re: Compiling UQM with MinGW
Post by: wherewp on February 24, 2007, 09:21:31 pm
Hello,

If you just want to play the standard uqm, note that there is a precompiled Windows binary available on the download page.

Anyhow, do you think you could post the last 10-20 lines that appeared on the console here?

-Where


Title: Re: Compiling UQM with MinGW
Post by: Novus on February 25, 2007, 08:55:26 am
http://koti.mbnet.fi/lonnberg/MinGWUQM.txt (http://koti.mbnet.fi/lonnberg/MinGWUQM.txt)
Following this instructions rigorously, I tried to compile UQM. MSYS acted like it compiled UQM, but I can't find a compiled UQM anywhere.
Help please!
I wrote those instructions, so it's only fair that I handle the fallout. :(

The executable should be right in the directory you ran all those commands in, if the compilation worked. If you can't find it, something must have gone wrong.

In any case, you can copy the MSYS output to the Windows clipboard by highlighting it. Please save this to a file and upload it somewhere I can read it.


Title: Re: Compiling UQM with MinGW
Post by: Valaggar on February 25, 2007, 09:44:43 am
http://www.savefile.com/files/516253
The console output is there.


Title: Re: Compiling UQM with MinGW
Post by: meep-eep on February 25, 2007, 10:02:03 am
You need the wspiapi.h file from the Microsoft Platform SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB) if you want to compile with Netplay.


Title: Re: Compiling UQM with MinGW
Post by: Novus on February 25, 2007, 10:27:11 am
Ah, right, I haven't updated the instructions since netplay was added (I was hoping this requirement would go away).

For your convenience, you can download this file separately here (http://www.koders.com/c/fid275FEAF57FA3E640A9425FB3A46D988E1F72B61D.aspx). Put it in the MinGW/include directory.


Title: Re: Compiling UQM with MinGW
Post by: Novus on February 25, 2007, 02:56:27 pm
Thank you. It is solved.
Thank you. Instructions corrected.


Title: Re: Compiling UQM with MinGW
Post by: meep-eep on February 25, 2007, 04:54:46 pm
(I was hoping this requirement would go away).
So am I. But neither MinGW nor Cygwin has getaddrinfo(), probably because Microsoft implemented it in a header file. And I don't think we are allowed to redistribute Microsoft's wspiapi.h file (though we are allowed to distribute programs built with it).



Title: Re: Compiling UQM with MinGW
Post by: Angelfish on October 12, 2009, 03:29:09 pm
... why isn't this useful file on the UQM SVN repository? :D


Title: Re: Compiling UQM with MinGW
Post by: Megagun on October 12, 2009, 04:59:59 pm
Uh...
And I don't think we are allowed to redistribute Microsoft's wspiapi.h file (though we are allowed to distribute programs built with it).


Title: Re: Compiling UQM with MinGW
Post by: Angelfish on October 12, 2009, 08:11:35 pm
I meant the .txt :P


Title: Re: Compiling UQM with MinGW
Post by: Novus on October 13, 2009, 06:04:05 pm
... why isn't this useful file on the UQM SVN repository? :D
... Because then people would expect me to keep it up to date? ;)


Title: Re: Compiling UQM with MinGW
Post by: Gekko on June 13, 2010, 09:14:01 pm
Bumping this ages old thread to update some of the stuff

http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz

^ doesn't install on my Windows 7, 64-bit. Instead i used
http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.1.tar.gz

Code:

Jesse Kaukonen@GEKKO-MAIN-WIN7 /e/uqmsource/uqm-0.6.2/sc2
$ C_INCLUDE_PATH=/usr/include:/usr/local/include ./build.sh uqm
  LINK     uqm-debug
c:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: ei l├Âydy -lvorbisfile
collect2: ld returned 1 exit status
make: *** [uqm-debug] Error 1


That " ei l├Âydy " is Finnish for "not found" (with umlauts broken)

So something needs to be changed to link to libvorbis properly. Suggestions?

EDIT: Solved. I got some help on #sc2

libvorbis installs to incorrect directory. It should install to /usr/local/lib, but instead installs the .dlls to /usr/local/bin.

Copy the .dll files to the correct directory:

cd /usr/local/bin
cp * ../lib

Then open /uqm-0.6.2/sc2/build/unix/config_proginfo_host

Find this part of the file

MINGW32*|CYGWIN*|cegcc)
    LIB_vorbisfile_CFLAGS=""
    LIB_vorbisfile_LDFLAGS="-lvorbisfile -lvorbis -lm -logg"
;;

Change the middle lines to

    LIB_vorbisfile_CFLAGS="-I/usr/local/include"
    LIB_vorbisfile_LDFLAGS="-L/usr/local/lib -lvorbisfile -lvorbis -lm -logg"

Then in /uqm-0.6.2/sc2/ run ./build.sh uqm config

Then build again, works for me


Title: Re: Compiling UQM with MinGW
Post by: Novus on June 14, 2010, 09:26:32 am
Thanks for the information on Windows 7 compatibility; I only have XP and Linux on my own equipment and limited access to Vista. I may have enough time to check and update the Windows building instructions in a few weeks (I have some vacation time that I have to use or lose).


Title: Re: Compiling UQM with MinGW
Post by: Quinarbre on September 28, 2010, 12:33:05 am
I'm at loss here. I've tried to follow those instructions too, I've tried Gekko's fix, I've copied the headers and dlls nearly everywhere, to no avail : "vorbisfile not found" again and again.

For some reason, the config script seems to superbly ignore vorbisfile, and skip directly to vorbisidec ; buildlog always ends with :
Quote
gcc -L/usr/lib -lmingw32 -lSDLmain -lSDL -mwindows -L/usr/lib -lmingw32 -lSDLmain -lSDL -mwindows -lSDL_image -lvorbisidec /tmp/build.1292.tmp.c.o -o /tmp/build.1292.tmp.out
c:\Progra~1\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lvorbisidec

collect2: ld returned 1 exit status

Failed program was:
+++ START /tmp/build.1292.tmp.c
int main(void) {
    return 0;
}
+++ END /tmp/build.1292.tmp.c
and never mentions vorbis nor vorbisfile.

I'm using mingw32 under Vista, everything else is working perfectly, and I even get sounds when I play, but I guess libmikmod is the one producing them, and I got no music at all.

EDIT : nevermind. pkgconfig was abusively called (and not found), when there was a perfectly functional vorbis.
The cleanest workaround I found was to edit config_proginfo_host and change:
Quote
case "$HOST_SYSTEM" in
    ARMV5|WINSCW|GCCE)
        LIB_vorbisfile_DETECT="false"
        ;;
    *)
        LIB_vorbisfile_DETECT="try_pkgconfig_lib vorbisfile vorbisfile"
        LIB_vorbisfile_DEPEND_DETECT_BIN="pkgconfig"
        ;;
esac

for :

Quote
case "$HOST_SYSTEM" in
    ARMV5|WINSCW|GCCE)
        LIB_vorbisfile_DETECT="false"
        ;;
    MINGW32*)
        LIB_vorbisfile_DETECT="true"
        ;;
    *)
        LIB_vorbisfile_DETECT="try_pkgconfig_lib vorbisfile vorbisfile"
        LIB_vorbisfile_DEPEND_DETECT_BIN="pkgconfig"
        ;;
esac

... which of course won't work if you don't have a proper vorbis install.


Title: Re: Compiling UQM with MinGW
Post by: Gekko on November 23, 2010, 09:49:08 pm
The latest version of the SVN seems to work without any fixes for me. As someone requested I made this (http://plantmonster.homeip.net/uqm/compiling). Simply the same tutorial, but with console output. These steps compile the latest SVN trunk on WIndows 7, 64-bits.


Title: Re: Compiling UQM with MinGW
Post by: thevagrantphilosopher on December 25, 2010, 06:41:06 pm
first and foremost, thanks for putting these instructions together!  I used these instructions and was able to get UQM to build on a windows 7 box. I'm posting to warn others that there is a newer version of this file:

http://libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz

that I had trouble with. Once I used the 1.2.13 version everything worked.


Title: Re: Compiling UQM with MinGW
Post by: Jormasteri on December 07, 2011, 04:45:25 pm
Sorry for bumping this thread but no matter what I try I cannot get UQM compiled.
I tried following these instructions to the letter but always get :

*** [uqm-debug.exe] Error 1

(trying to compile the newest UQM 0.7.0 with latest versions of all files mentioned in the guide.)

ALSO, when I compile uqm config, I get these :
build/unix/config_proginfo_host: line 251: libmikmod-config: command not found
build/unix/config_proginfo_host: line 252: libmikmod-config: command not found
build/unix/config_proginfo_host: line 253: libmikmod-config: command not found

P.S. before error I get with compiling uqm.exe, there are "undefined references" to oggaud.* files
I guess these mean my vorbis install is fubar?


Title: Re: Compiling UQM with MinGW
Post by: meep-eep on December 07, 2011, 05:34:57 pm
You can use the internal version of libmikmod. (rerun "./build.sh uqm config")


Title: Re: Compiling UQM with MinGW
Post by: Jormasteri on December 07, 2011, 07:30:10 pm
*sigh*

The latest error I get is : obj/release/src/libs/uio/match.c.o:match.c:(.text+0x764): undefined reference to 'regfree'


etc, etc.


Title: Re: Compiling UQM with MinGW
Post by: Jormasteri on December 07, 2011, 08:54:39 pm
Now that I somehow miraculoysly got it compiled, I get :
---------------------------
The Ur-Quan Masters
---------------------------
The Ur-Quan Masters encountered a fatal error.
Part of the log follows:

The Ur-Quan Masters v0.7.0 (compiled Dec  7 2011 21:00:32)
This software comes with ABSOLUTELY NO WARRANTY;
for details see the included 'COPYING' file.

Netplay protocol version 0.4. Netplay opponent must have UQM 0.6.9 or later.

  *** FATAL ERROR: Could not load basic content ***

UQM requires at least the base content pack to run properly.
This file is typically called uqm-0.7.0-content.uqm.  UQM was expecting
it in the E:/Pelit/UQM/content/packages directory.
Either your installation did not install the content pack at all, or it
installed it in a different directory.

Fix your installation and rerun UQM.

  *******************


---------------------------
OK  
---------------------------

And yes, I did copy the compiled uqm-debug.exe to game directory...



EDIT: Still fighting to get it working, this time on my laptop. No matter what I do I have problems with audio files it seems.
I get errors with ogg / vorbis, namely last problem is:
ld.exe: cannot find  -lvorbisfile
ld.exe: cannot find  -lvorbis
ld.exe: cannot find  -logg

What is the correct install method for logg and vorbis since I cannot seem to get them right no matter what?


Title: Re: Compiling UQM with MinGW
Post by: Jormasteri on December 08, 2011, 12:55:41 pm
I wasn't made for this stuff. I don't even know what changed that compiling succeeded.
But now it always gives error about basic content missing even though it is there,

Here's what stderr.txt says:

Initializing base SDL functionality.
Using SDL version 1.2.14 (compiled with 1.2.14)
Using config dir 'C:/Users/satpe/AppData/Roaming/uqm/'
Using 'C:/uqm/content' as base content dir.
Warning: Could not mount 'uqm-0.7.0-content.uqm': No such device.
Warning: Could not mount 'uqm-0.7.0-3domusic.uqm': No such device.
Warning: Could not mount 'uqm-0.7.0-content.uqm': No such device.
Warning: Could not mount 'uqm-0.7.0-voice.uqm': No such device.
Warning: Could not mount 'uqm-remix-disc1.uqm': No such device.
Warning: Could not mount 'uqm-remix-disc2.uqm': No such device.
Warning: Could not mount 'uqm-remix-disc3.uqm': No such device.
0 available addon packs.
Saved games are kept in C:/Users/satpe/AppData/Roaming/uqm/save/.


Title: Re: Compiling UQM with MinGW
Post by: Death 999 on December 08, 2011, 03:02:47 pm
Well, clearly it's got the wrong base directory - C:\uqm\ probably doesn't even exist. Try using the command line option to set the base directory appropriately. That'd be --contentdir=.\

... I think. Maybe it'd be /contentdir=.\ or something lik that if you're working from a windows command prompt.

Anyway, try running it with the --help option, to get some help on running it from the command line.


Title: Re: Compiling UQM with MinGW
Post by: Jormasteri on December 08, 2011, 04:08:01 pm
Well that's what's funny. C:\uqm is folder where I had source files & where I compiled.
Of course I had the base content file in proper folder under \uqm set up too.
I also tried having separate install with installer, copying uqm-debug.exe there but still it gives same error.

But gotta try those command line switches next.

EDIT: It would appear zlib was not installed correctly, as unzipping content files solved this.