Cross-compile help

  • Xenocide
    21st Sep 2010 Former Staff 0 Permalink
    All I'm getting from gcc is a ton of these:
    error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token

    Any ideas?
  • jacobrb
    21st Sep 2010 Member 0 Permalink
    no clue...

    try copying all your stamps folder, replacing powder toy(download another) and putting stamps there.
    that might work...
  • Taliathion
    21st Sep 2010 Member 0 Permalink
    How do I even get cross-compile to work? I don't feel like getting XCode to get GCC on my mac, so I have to cross-compile off Ubuntu to run it on anything but my crappy netbook. Please help :P
  • jacksonmj
    21st Sep 2010 Developer 0 Permalink
    Cross-compiling for Windows on Ubuntu:

    Install mingw packages from Ubuntu repositories. (I used mingw32-binutils, mingw32-runtime, and gcc-mingw32)

    Download SDL-devel-1.2.14-mingw32.tar.gz from http://www.libsdl.org/download-1.2.php. Extract the contents of the subfolder SDL-1.2.14 of this archive into /usr/i586-mingw32msvc
    Download bzip2-1.0.5-2-mingw32-dev.tar.gz and libbz2-1.0.5-2-mingw32-dll-2.tar.gz from mingw on Sourceforge. Extract these into /usr/i586-mingw32msvc


    The compiler does not seem to like _inline or the #ifdef WIN32 version of x86_cpuid(). While adding #undef WIN32 somewhere is a tempting option, this messes up things like the path separator and stamps folder creation, and may harm compatibility with other compilers (I assume compatibility with other compilers was the original reason for using _inline?).

    I chose to replace:
    #ifdef WIN32
    with:
    #if defined(WIN32) && !defined(__MINGW32__)
    for x86_cpuid() and where _inline is used, in the hope that this will work as before in other compilers like Visual Studio (I do not use it, so cannot test).


    Compiling with make powder-sse3.exe and similar should then work. The resulting .exe needs the SDL.dll and libbz2-2.dll files from /usr/i586-mingw32msvc/bin in order to run.




    Taliathion
    I know nothing about macs or compiling for them, sorry.
  • zc00gii
    21st Sep 2010 Banned 0 Permalink
    This post is hidden because the user is banned
  • Xenocide
    21st Sep 2010 Former Staff 0 Permalink
    jacobrb
    wtf? Did you read the thread topic and post in full or did you just autopilot? O_o

    jacksonmj
    Doing all that now ^^ will let you know
  • pilojo
    21st Sep 2010 Member 0 Permalink
    I get
    [Linker error] undefined reference to `WinMain@16'
    any idea what that is?
  • Xenocide
    21st Sep 2010 Former Staff 0 Permalink
    EEETS ALIIIIVE!!!!


    but it errors...

    /tmp/ccL6bLjY.o:powder.c:(.text+0x2cf2): undefined reference to `_max'
    collect2: ld returned 1 exit status
    make: *** [powder-sse3.exe] Error 1


    fgrep _max * returns nothing O_o
  • jacksonmj
    21st Sep 2010 Developer 0 Permalink
    antb
    Line 600 ( below // interpolator, above mv = max(fabsf(..... )
    Change to
    #if defined(WIN32) && !defined(__MINGW32__)


    For some strange reason 41.3 worked fine without this change....
  • Xenocide
    21st Sep 2010 Former Staff 0 Permalink
    got it, I have Win32 compilation AT LAST!!!

    You are a god-send Jacksonmj