7

Installed the mingw and cloned the "latest stable" branch of QEMU with

sudo apt-get install -y mingw-w64
cd ~/
git clone -b stable-2.2 git://git.qemu.org/qemu.git
cd ~/qemu

Then from @http://wiki.qemu.org/Hosts/W32#Building_QEMU_for_W64 I tried:

./configure --cross-prefix=amd64-mingw32msvc-

and now I'm getting:

ERROR: "amd64-mingw32msvc-gcc" either does not exist or does not work

Update:

~/Scripts/qemu$ ./configure --cross-prefix=x86_64-w64-mingw32-
ERROR: pkg-config binary 'x86_64-w64-mingw32-pkg-config' not found

2nd Update:

Fixed previous issue with

sudo link /usr/bin/pkg-config /usr/bin/x86_64-w64-mingw32-pkg-config
sudo apt-get --no-install-recommends -y build-dep qemu

but now I'm getting:

owner@K53TA:~/qemu$ ./configure --cross-prefix=x86_64-w64-mingw32-

ERROR: zlib check failed
       Make sure to have the zlib libs and headers installed.

but zlib1g-dev IS INSTALLED

4
  • 2 Questions: 1. Are you trying to build Qemu for Windows? 2. Have you installed the mingw compiler?
    – eyoung100
    Commented Dec 9, 2014 at 23:07
  • @eyoung100 yes, and yes.
    – GlassGhost
    Commented Dec 10, 2014 at 5:25
  • Why not Consider using WinQemu? What your doing, they've already done using VC2008. If you insist on Cross Compiling, 2 more questions: 1. Is your build host 64-bit? 2. Is your Windows Install 32-bit?
    – eyoung100
    Commented Dec 10, 2014 at 14:38
  • 1
    @eyoung100 why would I use VC2008, when I can use ubuntu from a VM? I'm interested in compiling it, not just downloading it.
    – GlassGhost
    Commented Apr 4, 2015 at 22:15

1 Answer 1

2

Warning: This answer is a Work In Progress

Even though I asked the OP to consider using WinQemu, I'm officially writing an answer for those that choose to "do it from scratch." Assuming your build host is 64-bit and your Windows is 32-bit:

  1. We need to remove the OP's failed install of the cross-compile tools, using:
    sudo apt-get --purge remove mingw-w64
    rm -vR ~/qemu
  2. Now we must decide on our Architecture. If your Build host is 64-bit, and your Windows is 32-bit, use:
    sudo apt-get install gcc-mingw32 mingw32-binutils mingw32-runtime
  3. If your Build host is 64-bit, and your Windows is 64-bit, use:
    sudo apt-get install gcc-mingw32 mingw32-binutils mingw-w64
  4. Optional: Add SDL Support by:
    wget http://www.libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz
  5. Now we download the Source Tarball, and untar it. You can also use the Git Clone as the OP did, but you only need to choose one option: sudo apt-get install wget && wget http://wiki.qemu-project.org/download/qemu-2.2.0.tar.bz2 && tar -xvjpf qemu-2.2.0.tar.bz2 && cd qemu-2.2.0
  6. Now we configure the build. If your Build host is 64-bit, and your Windows is 32-bit, use: configure --cross-prefix=i586-mingw32msvc- [--extra-cflags=-mthreads]
  7. If your Build host is 64-bit, and your Windows is 64-bit, use: configure --cross-prefix=amd64-mingw32msvc-

Note: If the Configure Phase fails, you must fix the configure errors, as the OP alluded to. At this point, a configure failure is most likely caused by missing libraries

2
  • Under ubuntu 14.04 there is no package gcc-mingw32. I tried with mingw32 and gcc-mingw-w64-i686 but after configure, I got : ERROR : pkg-config binary 'i586-mingw32msvc-pkg-config' not found
    – tweetysat
    Commented Oct 15, 2015 at 9:22
  • for ubuntu 14.04 use the command "sudo apt-get install mingw32 mingw32-binutils mingw32-runtime"
    – snapo
    Commented Mar 5, 2016 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .