Step-by-step QEMU compilation under Windows (MinGW/MSYS)

using QEMU howto's - how to install a guest OS under QEMU, etc - people are more then welcome to submit any documents they written and share them with the community

QEMU Compilation modifications

Postby DenisS on Thu Jan 05, 2006 1:13 pm

Hello,

Here are my 2 (€)cents contribution to Qemu compilation ;-)

First, you will need to change step 10 (cvs server name changed):
cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/qemu co qemu

Same modification applies to step 11, il you want to download QVM86 :
cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/qvm86 co qvm86

If you want to use KQEMU instead of QVM86, you just have to follow the instructions
given on the QEMU website (http://qemu.org/kqemu-doc.html).
Don't proceed with step 11 in that case.

But you'll need one modification before you can compile :
Comment out the following lines in \home\<UserName>\qemu\kqemu\makefile.winnt

#$(TARGET): $(OBJECTS)
# $(CROSS_PREFIX)gcc -Wl,--base-file,base.tmp -Wl,--entry,_DriverEntry@8 \
# -nostartfiles -nostdlib -o junk.tmp $(OBJECTS) -lntoskrnl -lhal
# rm junk.tmp
# $(CROSS_PREFIX)dlltool --as=as --dllname $(TARGET) --base-file base.tmp \
# --output-exp temp.exp
# rm base.tmp
# $(CROSS_PREFIX)gcc -Wl,--subsystem,native -Wl,--image-base,0x10000 \
# -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 \
# -Wl,--entry,_DriverEntry@8 -Wl,--stack,0x40000 -Wl,temp.exp \
# -mdll -nostartfiles -nostdlib -o $(TARGET) \
# $(OBJECTS) -lntoskrnl -lhal
# rm temp.exp

When you download KQEMU, kqemu.sys is already compiled (and you don't get the sources anyway...)
So it's not necessary to include these steps in the make process.

Well, for me at least, this worked fine on the latest CVS version...

Comike, could you please update your howto ?

HTH,
Denis
DenisS
 
Posts: 6
Joined: Thu Jan 05, 2006 12:42 pm
Location: France - Moselle

Postby comike on Fri Jan 06, 2006 2:58 am

I will try to do it tomorrow, thanks for the information!
Take a look at QGui - QEmu Launcher
Compile QEmu for Windows from CVS following this guide.
User avatar
comike
helper
 
Posts: 48
Joined: Mon Jun 27, 2005 1:18 pm
Location: Spain

Postby hawkeye on Mon Aug 07, 2006 1:06 am

I followed the first post, downloaded all linked to, and set it up as specified, however, when I do a ./configure no compiler is found, and manually ln -s to /mingw/MinGW/bin/mingw32-gcc.exe or gcc.exe (and re-running ./configure) causes make to fail... ./configure says SDL's missing script doesn't support --run (and I'v confirmed this manually). It also says cc (linked to gcc above) can't build executables.... make reveals the error gcc is giving--gcc doesn't understand the makefile's passed parameters and is saying 'no input files'.

It seems this is issues with mingw/msys configuration, but I can't find anything about it, nor can I figure it out myself... I've been trying to compile qemu without SDL or ./configure-ing it using an IDE in Windows (just to get it compiling, not necessarily working) but am hung up on opc.h and gen-ops.h... I gather these are generated by dyngen.

Have this listed environment been successfully tested, or am I just foolishly missing something (or do I need to file a bug report)? I followed the instructions to the letter, but gcc is 'missing', not in path, or not a helpful version.

Versions of msys/mingw as linked to above, Windows XP Pro x86, not that this should have any bearing...

Thanks for your time!

Justin
hawkeye
 
Posts: 1
Joined: Mon Aug 07, 2006 12:48 am

Postby DualC on Tue Sep 05, 2006 8:10 am

Hello All.

I have also tried to Compile, after the Steps inda instruction.

I success, if i compile a older version, the qvm86 patch also work great....

To my BIG problem, after a successfull compile, i can't use the programs build, if i try run the compiled qemu.exe file, nothing happends.

I get nothing on my screen, if i build using "./configure --target-list=i386-softmmu --static --enable-adlib", nothing at all happend.

If i compile lake same but taking "--static" away, it complains about SDL.DLL file missing.. but if i apply what file, NOTHINMG happends..

WHAT have i done wrong.. ?

I also cant compile the latest CVS builds .. but what's maybee are normal ?

/M
DualC
 
Posts: 2
Joined: Tue Sep 05, 2006 8:02 am
Location: Sweden

Postby DualC on Tue Sep 05, 2006 6:20 pm

YES..

Im Sucessfully compiled the latest CVS today, no errors at all.

Im soo glad, i success

Using MiniGW 5.0.2, and MSYS 1.0.11, SDL 1.2.11, and zlib 1.2.3..

It compiled perfectly and running well.
DualC
 
Posts: 2
Joined: Tue Sep 05, 2006 8:02 am
Location: Sweden

Postby QEMUVBOX on Fri Jan 26, 2007 9:39 pm

I tried this step-by-step instruction for qemu-0.8.2. Steps prior to 14 work fine.

At step 14, during make all. I got the following messages:
/home/tony/qemu/texi2pod.pl qemu-doc.texi qemu.pod
make: /home/tony/qemu/texi2pod.pl: Command not found
make: *** [qemu.1] Error 127

Where can I find out more about what this error code 127 means?

Or is there a more current copy of this instruction?

Thank you.
Ricky
QEMUVBOX
 
Posts: 3
Joined: Fri Jan 26, 2007 9:11 pm

Postby dignome on Fri Jan 26, 2007 9:42 pm

QEMUVBOX wrote:I tried this step-by-step instruction for qemu-0.8.2. Steps prior to 14 work fine.

At step 14, during make all. I got the following messages:
/home/tony/qemu/texi2pod.pl qemu-doc.texi qemu.pod
make: /home/tony/qemu/texi2pod.pl: Command not found
make: *** [qemu.1] Error 127


Use a recent copy of qemu from cvs. It does not build the documentation if the tools to do this are not found. qemu-snapshots/
User avatar
dignome
helper
 
Posts: 786
Joined: Thu Jan 12, 2006 5:09 am

The snapshot did reduces the warning message but not the err

Postby QEMUVBOX on Fri Jan 26, 2007 10:44 pm

Hi Dignome,

The snapshot that you recommended did reduces the warning messages, however, it did not resolved the error 127.

By the way for qemu-0.8.2 compilation , I am using the following:

1) MSYS-1.0.10.exe
2) msysDTK-1.0.1.exe
3) MinGW-3.1.0.1.exe
4) SDL-1.2.8.tar.gz
5) zlib-1.2.2.tar.gz
6) directx-devel-tar.gz

Could you confirmed that these components are still good for the current version compilation?

Thank you very much.
QEMUVBOX
 
Posts: 3
Joined: Fri Jan 26, 2007 9:11 pm

Re: The snapshot did reduces the warning message but not the

Postby dignome on Sat Jan 27, 2007 9:46 pm

QEMUVBOX wrote:Hi Dignome,

The snapshot that you recommended did reduces the warning messages, however, it did not resolved the error 127.


Error 127 is not very specific. Please post the relevant portion of the build where it fails.
User avatar
dignome
helper
 
Posts: 786
Joined: Thu Jan 12, 2006 5:09 am

Postby QEMUVBOX on Tue Jan 30, 2007 6:14 am

Hi dignome,

I never thought it will be this time consuming setting this mingw environment up on windows.

The linux version took me only five minutes, voila, it is now up and running.

==============================================
sdl-config, does this file serve any purpose? I suspect the output of this file is pipe to some program. Is it configuration program? There is no documentation about it.

Installed 1) Configure Zlib with ./configure --prefix=/mingw
2) Configure SDL with ./configure --prefix=/mingw
3) Configure Qemu with ./configure --prefix=/mingw

then set sh environment
export INCLUDE=/mingw/include
export LIB=/mingw/lib

path contains /mingw/bin:/bin .... (and other path)

tested qemu-img.exe -- created the image file but could not test it with qemu.exe

============= Output from the Make command =============
$ make
gcc -DQEMU_TOOL -Wall -O2 -g -fno-strict-aliasing -I. -g -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o qemu-img.exe qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c -lz
qemu-img.c: In function `get_human_readable_size':
qemu-img.c:172: warning: int format, different type arg (arg 4)
qemu-img.c:184: warning: int format, different type arg (arg 4)
qemu-img.c: In function `img_create':
qemu-img.c:376: warning: int format, different type arg (arg 2)
qemu-img.c: In function `img_info':
qemu-img.c:688: warning: int format, different type arg (arg 5)
gcc -Wall -O2 -g -fno-strict-aliasing -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o dyngen.exe dyngen.c

<<< these warnings seem like there is a versioning problem >>> true or false?


make -C i386-softmmu all
make[1]: Entering directory `/home/tony/qemu-0.8.2/i386-softmmu'
make[1]: *** No rule to make target `vl.c', needed by `vl.o'. Stop.
make[1]: Leaving directory `/home/tony/qemu-0.8.2/i386-softmmu'
make: *** [subdir-i386-softmmu] Error 2

<<< some path are not set properly >>>>> true or false?
QEMUVBOX
 
Posts: 3
Joined: Fri Jan 26, 2007 9:11 pm

Weird compiling errors

Postby fallenangel on Sun Apr 01, 2007 3:41 am

Hi all,
I'm somewhat confused about why my qEmu wont compile.
I've followed the steps in the guide to the letter, but I'm having trouble compiling.. anything.

I know gcc is installed because I can gcc -ver, and get the results back, but, when I try and ./configure the SDL package, I get the following in the console:
Code: Select all
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

So, looking in config.log, I notice the following:
Code: Select all
configure:2608: checking for C compiler default output file name
configure:2611: gcc    conftest.c  >&5
gcc.exe: installation problem, cannot exec `cc1': No such file or directory


Although it's probably realllly obvious, has anyone got any ideas?

Thanks!
fallenangel
 
Posts: 2
Joined: Sun Apr 01, 2007 3:33 am

Postby titeo on Sun May 27, 2007 12:08 pm

Great work! Thanks for the infomation :D
titeo
 
Posts: 1
Joined: Wed May 23, 2007 7:49 am

Re: Step-by-step QEMU compilation under Windows (MinGW/MSYS)

Postby Parshant64 on Mon Feb 08, 2010 8:19 am

Hi,

I did 11 steps successfully but when I compile the Qemu (12 step) It gives error "gcc does not exist or does not work".
What might be the issue?
Parshant64
 
Posts: 0
Joined: Wed Jan 27, 2010 8:33 am

Re: Step-by-step QEMU compilation under Windows (MinGW/MSYS)

Postby ericdeko411 on Sun Jun 27, 2010 1:56 am

Parshant64 wrote:Hi,

I did 11 steps successfully but when I compile the Qemu (12 step) It gives error "gcc does not exist or does not work".
What might be the issue?



Got the same error :( wondering what happened.
User avatar
ericdeko411
 
Posts: 0
Joined: Fri Oct 09, 2009 2:06 pm

Previous

Return to HOWTOs

Who is online

Users browsing this forum: No registered users and 1 guest