Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: Frankenpod on October 08, 2020, 09:11:20 PM

Title: Trying and failing to build simulator for Windows10 on Ubuntu box
Post by: Frankenpod on October 08, 2020, 09:11:20 PM
I'm struggling with this.  I want to build an up-to-date simulator to run on windows (mainly in order to try and build the coverflow image database on the PC, because I can't get that to work on iflash modded ipods, presumably for the usual disk-writing ATA-driver reasons).

When I try and follow the instructions I get to this bit:

If you're getting this message during configuring: '*** Your compiler (/usr/bin/gcc) does not produce Win32 executables!', try doing this:

CC=/usr/bin/i586-mingw32msvc-gcc CXX=/usr/bin/i586-mingw32msvc-gcc ./configure --host=i586-mingw32msvc --prefix=${HOME}/mingw32-sdl

And as I do get that message, I try what it suggests, but then I end up (after lots of "checking....yes" lines) getting

"checking Win32 compiler...no
Your compiler (gcc) does not produce Win32 exectuables!"

Possibly relevant is that I couldn't find Mingw32 or work out how to install it, and ended up installing Mingw64.

Help on how to compile the simulator for windows (on Ubuntu), or just a download of the up-to-date compiled simulator with the current version of rockbox, would be appreciated.


Title: Re: Trying and failing to build simulator for Windows10 on Ubuntu box
Post by: bluebrother on October 15, 2020, 03:30:59 PM
You didn't mention what player you're trying to build for, so I cannot build one for you ...


If you're getting this message during configuring: '*** Your compiler (/usr/bin/gcc) does not produce Win32 executables!', try doing this:

CC=/usr/bin/i586-mingw32msvc-gcc CXX=/usr/bin/i586-mingw32msvc-gcc ./configure --host=i586-mingw32msvc --prefix=${HOME}/mingw32-sdl

Not sure how you're trying to build, but Rockbox doesn't use autotools, so the build process looks a bit different and that ./configure won't work like that.
When I'm trying to configure Rockbox for a cross compile sim build I'll get something like this:
Code: [Select]
Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, (W)arble codec tool: (Defaults to N)
a
Advanced build selected

Enter your developer options (press only enter when done)
(D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,
Win(6)4 crosscompile, (T)est plugins, S(m)all C lib, Logf to Ser(i)al port:, (R)TC MOD
w
Enabling Windows cross-compiling (32-bit)
s
Simulator build enabled

done
Unsetting APPLICATION define for SIMULATOR build
Using source code root directory: /home/dom/projects/rockbox
WARNING: unable to find cross-compiler for 32-bit Windows environment!
WARNING: it's none of "i686-w64-mingw32 i686-pc-mingw32 i586-mingw32msvc".
WARNING: set your compiler prefix with CROSS_COMPILE="your-prefix-" and
WARNING: re-run configure again!

First, you need the actual cross compiler. You're trying to use the host compiler (i.e. the compiler on the Linux system for compiling Linux binaries). You need to install the cross compiler. You can either do that using the compiler your distro ships or build it yourself.

A cross compiler usually will have a prefix. You need to know this prefix. Usually it's something like i686-pc-mingw32. Now you need to make sure the compiler is in the PATH and you know the prefix. Then you run configure and pass those values. I'm using mxe (mxe.cc) as cross compiler, and I have it in ~/local/mxe. You need to adjust the paths and prefix values according to your setup. If you installed the cross compiler from your distro sources you'll likely don't need to adjust PATH.
Code: [Select]
mkdir build && cd build
PATH=~/local/mxe/usr/bin/:$PATH CROSS_COMPILE=i686-w64-mingw32.static- ../tools/configure
Configure (see above) and then simply make the sim. lua and mikmod plugins didn't build for me, so I had to disable them. The resulting binary worked find in a Windows VM.

Btw, I prefer to use mxe since it does build the cross compiler for me, and also has sdl (I only compile the packes I use though, make cc sdl should be sufficient in your case)
Title: Re: Trying and failing to build simulator for Windows10 on Ubuntu box
Post by: Frankenpod on October 16, 2020, 08:20:26 AM
Oops - sorry, I started posting about it in a different thread in different sub-forum and forgot to repeat in this one what the device was.

this began in

https://forums.rockbox.org/index.php/topic,53430.0.html

It's for the Ipod classic.  Looking to get the pictureflow plugin to work, but it doens't manage to build the database on he actual device, and I don't know if that's a bug in the plugin or if it's just because the device is flash modded (or because it has too many tracks).  The simulator builds available for download don't use the most recent version of the pictureflow plugin so I can't use those.

Will read your advice and try again to build the simulator (when I can summon up the energy to have another shot at it!  I'm not very experienced with linux)
Title: Re: Trying and failing to build simulator for Windows10 on Ubuntu box
Post by: bluebrother on October 16, 2020, 04:23:15 PM
I created one here: https://drive.google.com/folderview?id=0B8pPsvGJ3RdKfnhyTDAwTWstMlhNR3NDanZURHFzOEI4ZHhoQUJ5OXUzN1NDRlp0U0hZNzQ

Win32 binary, current development snapshot. I had to disable mikmod and lua plugins, since those didn't compile (therefore the build will show up as modified, it acually isn't modified except disabling those 2 plugins)

Also, are you working on Linux or WSL?
Title: Re: Trying and failing to build simulator for Windows10 on Ubuntu box
Post by: Frankenpod on October 16, 2020, 04:50:18 PM
Oh, thanks!  Will try with that.

Was using my old 'retired' PC, which now runs Ubuntu Linux.
Title: Re: Trying and failing to build simulator for Windows10 on Ubuntu box
Post by: bluebrother on October 17, 2020, 10:37:26 AM
If you're on a real Linux box and not WSL I'd suggest using mxe to get the cross compiler. The nice thing is that it also includes sdl (and lots of other things, in case you need it :) ). You basically clone mxe, then cd to the folder and make cc sdl and should be good to go. I usually put it into a folder ~/local/mxe, though you can put it any place you like. The command line I posted earlier should then match nicely.