Hi Chris,

It  toke several hours :( to download and compile, but really it seems the
best and easiest way to install Mingw on Linux.

The problem of merging sources from different paths seems to be fixed. Now,
everything is token from the Mingw cross-compiling environment.

On the other hand, SWFTools does not yet compile and a similar error is
raised:


i686-pc-mingw32-gcc -c -DHAVE_CONFIG_H   -Ilame -Ilib/lame -fPIC -Wimplicit
-Wreturn-type -Wno-write-strings -Wformat -O -fomit-frame-pointer
-DSWFTOOLS_DATADIR=\"/usr/local/share/swftools\" os.c -o os.obj
os.c:1:0: warning: -fPIC ignored for target (all code is position
independent) [enabled by default]
In file included from
/opt/mingw/usr/lib/gcc/i686-pc-mingw32/4.6.0/../../../../i686-pc-mingw32/include/objbase.h:4:0,
                 from
/opt/mingw/usr/lib/gcc/i686-pc-mingw32/4.6.0/../../../../i686-pc-mingw32/include/ole2.h:9,
                 from
/opt/mingw/usr/lib/gcc/i686-pc-mingw32/4.6.0/../../../../i686-pc-mingw32/include/windows.h:114,
                 from os.c:28:
/opt/mingw/usr/lib/gcc/i686-pc-mingw32/4.6.0/../../../../i686-pc-mingw32/include/rpcndr.h:52:23:
error: two or more data types in declaration specifiers
os.c: In function 'getRegistryEntry':
os.c:80:2: warning: format '%d' expects argument of type 'int', but argument
3 has type 'long int' [-Wformat]
os.c:86:2: warning: format '%d' expects argument of type 'int', but argument
3 has type 'long int' [-Wformat]
make[1]: *** [os.obj] Error 1
make[1]: Leaving directory `/home/pablo/swftools/lib'
make: *** [all] Error 2


The os.c line 58 is highlighted in bolt below: *

*#ifdef WIN32
*char* getRegistryEntry(char*path)*
{
    int res = 0;
    HKEY key;
    long rc;
    long size = 0;
    DWORD type;
    char*buf;
    rc = RegOpenKeyEx(HKEY_CURRENT_USER, path, 0, KEY_ALL_ACCESS, &key);
    if(rc)
    rc = RegOpenKeyEx(HKEY_CURRENT_USER, path, 0, KEY_READ, &key);
    if(rc)
    rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0, KEY_ALL_ACCESS, &key);
    if(rc)
    rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0, KEY_READ, &key);

    if (rc) {
    fprintf(stderr, "RegOpenKeyEx failed\n");
    return 0;
    }
    rc = RegQueryValueEx(key, NULL, 0, 0, 0, (LPDWORD)&size) ;
    if(rc) {
    fprintf(stderr, "RegQueryValueEx(1) failed: %d\n", rc);
    return 0;
    }
    buf = (char*)malloc(size+1);
    rc = RegQueryValueEx(key, NULL, 0, &type, (BYTE*)buf, (LPDWORD)&size);
    if(rc) {
    fprintf(stderr, "RegQueryValueEx(2) failed: %d\n", rc);
    return 0;
    }
    if(type == REG_SZ || type == REG_EXPAND_SZ) {
    while(size && buf[size-1] == '\0')
          --size;
    buf[size] = 0;
    /* TODO: convert */
    return buf;
    } else if(type == REG_BINARY) {
    return buf;
    }
    return 0;
}


Thanks.
Pablo.


2011/6/9 Chris <[email protected]>

> You've not set yourself an easy task!  Tried this..?
>
>  http://mingw-cross-env.nongnu.org/
>
> It may help. ( but no guarantees )
>
> Regards,
>
>
> Chris.
>
> >On Wed, 8 Jun 2011 21:44:02 +0200
> >Pablo Beltran <[email protected]> wrote:
>
> > Hi Chris,
> >
> > Reset for all previous emails.
> >
> > At this point, I'm trying to compile the latest SWFTools sources
> available
> > from the Git repository on my Linux (Ubuntu) by using the Mingw
> > cross-compiling feature.
> >
> > I've installed the Mingw version available from Ubuntu's soft repository:
> > apt-get install mingw*
> >
> > I've downloaded following libraries required by SWFTools and they were
> > unziped in the */home/pablo/kk* directory:
> >
> > * zlib-1.2.3-lib.zip
> > * jpeg-6b-4-lib.zip
> > * freetype-2.3.5-1-lib.zip
> > * giflibd-4.1.4-1-lib.zip
> >
> > Those libraries are the latest version available from
> > http://sourceforge.net/projects/mingwrep/files/
> >
> > Build:
> >
> > CFLAGS="-I/home/pablo/kk/include -L/home/pablo/kk/lib"
> > CXX=i586-mingw32msvc-g++ CPP=i586-mingw32msvc-cpp CC=i586-mingw32msvc-gcc
> > ./configure --host=i586-mingw32msvq && make
> >
> > Configure seems to work fine, but make fails.
> >
> > Output:
> > ....
> > i586-mingw32msvc-gcc -c -DHAVE_CONFIG_H   -I/usr/local/include/freetype2
> > -I/usr/local/include -Ilame -Ilib/lame -fPIC -Wimplicit -Wreturn-type
> > -Wno-write-strings -Wformat -O -fomit-frame-pointer
> -I/home/pablo/kk/include
> > -L/home/pablo/kk/lib modules/swfbits.c -o modules/swfbits.obj
> > modules/swfbits.c:1: warning: -fPIC ignored for target (all code is
> position
> > independent)
> > In file included from /usr/local/include/jpeglib.h:25,
> >                  from modules/swfbits.c:40:
> > /usr/local/include/jconfig.h:24: error: two or more data types in
> > declaration specifiers
> > /usr/local/include/jconfig.h:24: warning: useless type name in empty
> > declaration
> > make[1]: *** [modules/swfbits.obj] Error 1
> > make[1]: Leaving directory `/home/pablo/swftools/lib'
> > make: *** [all] Error 2
> >
> > The swfbits.c:40 line is:
> >
> > #include <jpeglib.h>
> >
> > This file is present in both places:
> >
> > /usr/local/include (linux version)
> > /home/pablo/kk/include (mingw version)
> >
> > As I declared the CFLAGS="-I/home/pablo/kk/include variable, then I guess
> > that jpeglib.h file should be read from /home/pablo/kk/include instead of
> > /usr/local/include.Nevertheless, the error occurs in the
> > /usr/local/include/jconfig.h:24  version!! So, maybe the problem is that
> I'm
> > merging mingw & native Linux sources during make.
> >
> >
> > 2011/6/8 Chris <[email protected]>
> >
> > > On Wed, 8 Jun 2011 12:43:07 +0200
> > > Pablo Beltran <[email protected]> wrote:
> > >
> > > > 2011/6/7 Chris <[email protected]>
> > >
> > > > > Quite possibly.  It is a community wiki though, so how
> > > > > about you giving it a shot yourself?  If you see that
> > > > > something is not quite right, change it! ;o)
> > > > >
> > > > Then I will update it, but before I want to build SWFTools by using >
> > > Mingw.
> > > >
> > > Ok. ;o)
> > >
> > > > Really I tried everything, search on Google hundred of times, modify
> > > > everything ... with no lucky.
> > >
> > > Only goes to prove, |Google is not the next best thing to sliced
> bread..
> > > ducky. ;o)
> > >
> > > > ..so the Mingw cross-compiler environment provided by Ubuntu works.
> > > >
> > > > At this point, the SWFTools' configure always fails:
> > > >
> > > > ERROR:
> > > > You need zlib to compile swftools
> > >
> > > In which case, ts not where it should be, or where the compiler system
> > > can find it.  You may have to be explicit with the compiler options.
> > >
> > > > I've installed jpeg, gif and freetype libraries. They are recognized
> > by
> > > the SWFTools' configure. But zlib is ignored though the headers
> > > > and libs are placed in the same directory (/usr/local/incude and
> > > > libs). Why SWFTools' configure finds other libraries but not zlib?
> > >
> > > I take it you mean zlib is in the same directory as the other
> libraries,
> > > yes?
> > >
> > > > I've installed an alternative zlib from Mingw's packages and then
> > > > SWFtools' configure recognize it.
> > >
> > > Which means the original path chosen was not correct.
> > >
> > > > Unfortunately, make stops after a compile error.
> > >
> > > What this time?
> > >
> > > > Really, is the author of SWFTools so busy and he have not time to
> > > > check whether the sources compile for Windows?
> > >
> > > Well, since Matthias provides Windows versions, they must!
> > >
> > > > Of course, maybe the sources compile and I'm a sort of incompetent
> :).
> > >
> > > Doubt it.  Probably just the wide variation of install methods.
> > >
> > > > Anyway, I would appreciate a simple email from the author saying:
> > > > "I've just compiled it for Windows so you are doing something wrong".
> > >
> > > You'd need to know ( and have yourself ) the same build environment.
> > >
> > > > Yes, but finally I changed my compiling environment to Linux+Mingw
> > > > cross-compiling. Pherhaps, my emails are bit confusing because I
> > > > started to trying compile on Windows and later on Linux+cross-
> > > > compiling features.
> > >
> > > To be honest, I've forgotten exactly whay you were doing this!  What
> > > is wrong with the existing precompiled Wndows binaries?
> > >
> > > > > > As I have no idea about Mingw corss-compiling, I
> > > > > > would appreciate some help.
> > > > >
> > > > > Ages since I've done it!  Maybe I'll get a moment to try
> > > > > it from the top.
> > >
> > > > Yes Chris, please, try it. A would appreciate a loooooooooot your
> > > > feedback!
> > > > :)
> > >
> > > OK. ;o)  Which way are we going to try it?  Linux => Windows for
> > > Windows?  Or a Windows compile for Windows under MingGW?
> > >
> > >
> > > Chris
> > > --
> > > <[email protected]>
> > >
>
>
> --
> Chris <[email protected]>
>

Reply via email to