swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] Building SWFTools on Windows


From: Daichi Shinozaki
Subject: Re: [Swftools-common] Building SWFTools on Windows
Date: Mon, 07 Feb 2005 02:05:35 +0900
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616

Hi,

Matthias Kramm wrote:
Another option might have been to also add "LIBS" to your .profile:

    LIBS="-lgw32c"

Does this work, too?
Yes, it worked.

So the gnuwin32 compile of jpeglib uses char as boolean?
Yes, in gnuwin32\include\jconfig.h:

#ifdef __WIN32__
#include <windows.h>
/* Define "boolean" as unsigned char, not int, per Windows custom */
//#ifndef __RPCNDR_H__     /* don't conflict if rpcndr.h already read */
#ifndef boolean     /* don't conflict if rpcndr.h already read */
typedef unsigned char boolean;
#endif

I got a strange error described in below before typedef'ing
boolean as unsigned char.

[JPEG Boolean size problems on Windows?]
http://bugzilla.remotesensing.org/show_bug.cgi?id=188

Note: As an important side effect of builing on Windows,
the resulting exes is able to accept wildcard(*) in the command-line.

You can type "png2swf *.png" in your command-line, for example.


Any idea why that is so? Do they use a different program entry point
or something?

On Unix, glob patterns on command-line will be expanded by shell,
not by the program itself.
But on Windows, that was done by C-(mingw or microsoft or something) runtime library automagically. I don't know about cross-compiling, but you may need to link against some mingw-runtime library explicitly when doing cross-compiling?

By the way, could you compile this sample on your cross-compiling environment and run the resulting exe on Windows, what the result is?

--[glob.c]--
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>

/* To turns off tautomatic command line globbing,
 * set _CRT_glob to 0.
 */
int _CRT_glob = -1; /*** globbing ON ***/

int main (int argc, char* argv[]) {
    int i;
    printf ("Command line (via GetCommandLine) \"%s\"\n",
            GetCommandLine());
    for (i = 0; i < argc; i++)
        printf ("Argv[%d] \"%s\"\n", i, argv[i]);
    return 0;
}

I built and run it on Windows, got following output:
C:> gcc glob.c -o glob.exe
C:> glob.exe *.c
Command line (via GetCommandLine) "glob *.c "
Argv[0] "glob"
Argv[1] "glob.c"
Argv[2] "noglob.c"
Argv[3] "test.c"

P.S.
Just a note, I read init.c of mingw-runtime source, default behaviour is *globbing=on*.
http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/init.c?rev=1.3

Regards,
--
Daichi Shinozaki
SHIELD.JP Admin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]