Title: Compiling uqm tools Post by: Death 22 on December 02, 2007, 11:44:21 pm Hi, I'm trying to compile some of the tools in the uqm tree, specifically, the unpkg tool in tools/pkg. I'm not having much luck, however...
I followed the instructions to the book. Installed MinGW, then MSYS (on a virgin Windows, just to be sure). But "make unpkg" first gives me an error about a missing mman.h. OK, I copied that header to my include directory (where is it usually supposed to come from, by the way?) But then I get the next error message: unpkg.c:838: error: too many arguments to function 'mkdir' Line 838 does indeed contain a call to mkdir with 2 arguments. Now I'm not quite sure what's happening. Tried with gcc 3.4.5 and 4.2.1, but the error persists. Does anyone know what I'm missing? Thanks in advance... Title: Re: Compiling uqm tools Post by: meep-eep on December 02, 2007, 11:59:01 pm Hmm... I don't think anyone ever tried to compile that on Windows.
Anyhow, Windows mkdir() is not POSIX-compatible. Just remove the extra argument, the mode doesn't mean anything to Windows anyhow. mmap() is going to be a bigger problem. Windows doesn't have it at all (which explains your missing mman.h). You could use Cygwin, which provides a POSIX environment for Windows. Or you could rewrite this code a bit; instead of mapping the file to memory, you allocate a large enough buffer and read the file into it. A more structural solution would be to read the file into memory in parts, but the files this program is intended to work on are small enough to fit into memory entirely. Title: Re: Compiling uqm tools Post by: Novus on December 03, 2007, 01:05:21 pm You could use Cygwin, which provides a POSIX environment for Windows. Seems to work correctly under Cygwin.Title: Re: Compiling uqm tools Post by: Death 22 on December 03, 2007, 06:00:00 pm You're right - the compile does work under cygwin! Sadly the extraction doesn't seem to work properly, I just get a bunch of 1K files with hex names. And yes, I did specify "-t pc"....
Oh what the hell. Think I'll see if this is any easier under Linux! :) Thanks. Title: Re: Compiling uqm tools Post by: Novus on December 03, 2007, 06:14:41 pm Well, it works the same for me on Cygwin and openSUSE. SC2 resources apparently don't have names, just numbers, so the files are going to be named in hex (working out what the contents are is left as an exercise for the student). Many of them are going to be very small (snippets of text, palettes, that sort of thing).
Title: Re: Compiling uqm tools Post by: meep-eep on December 03, 2007, 08:29:13 pm These numbers are the resource identifiers. In the number itself is encoded which type a file is and to what "package" it belongs. See doc/devel/resources for a description.
|