[Spice-devel] Problems compiling SPICE Windows client SDK 7.1

John A. Sullivan III jsullivan at opensourcedevel.com
Tue Jul 5 16:01:17 PDT 2011


On Tue, 2011-07-05 at 09:35 +0300, Arnon Gilboa wrote:
> Hi John,
> See my comments below.
> Arnon
> 
> John A. Sullivan III wrote:
> > Hello, all.  Being a Windows ignoramus, I am having a nightmare of a
> > time compiling the Windows client on our Windows 7 build system.  I'll
> > recount them for other ignorami and to ask for help for the things I
> > could not figure out.
> >
> > I installed the Windows SDK 7.1 and it installed without compilers
> > because we had .net 3.5 installed.  I installed 4.0 and reinstalled the
> > SDK and I know had compilers.
> >
> >   
> Currently, the only supported environment for Spice windows client 
> compilation is Visual Studio 2008.
> To use our precompiled libraries (wspice) use version 9.0.30729.1 SP.
> There might be problems with the libs if you use other VS versions.
> > The build instructions under Windows say, "The prerequisites are
> > available as binaries in one package on the download page." However, I
> > did not see such a binary on the download page.
> >
> > I downloaded spice-0.8.1, spice-protocol-0.8.0, and wspice-x64_20110308.
> >   
> You have downloaded everything needed for building the client.
> In addition you need to have Python (2.7+) & pyparsing installed.
> "The prerequisites available as binaries..." is wspice.
> > I then did:
> >
> > setenv /Release /x64 /win7
> >
> > set REDC_BUILD_DIR=D:\Binaries\x64\Win7
> > set SPICE_PROTOCOL_DIR=C:\Users\Administrator\Downloads\spice
> > \spice-protocol-0.8.0
> > set SPICE_LIBS=C:\Users\Administrator\Downloads\wspice-x64_08032011
> >
> >   
> I would prefer other locations for the files...
> but if C:\Users\Administrator\Downloads is fine for you, it's ok for me.
> > C:
> > cd \Users\Administrator\Downloads\spice\spice-0.8.1\client\windows
> > redc.sln
> >
> > It had no idea of what to do with the file - no association.
> >   
> VS will open it
> > Some Internet research, reading the SDK Release Notes, and a little
> > while later and I did:
> > msbuild -p:platform=X64 redc.sln
> >
> > It complained that it could not find vcbuild.exe.
> >   
> We have never built it with msbuild or vcbuild.exe.
> If you want to build using VS from cmd line, use something like:
> devenv.exe redc.sln /build "Release|x64"
> > Some more research and I found that the 7.1 SDK uses msbuild and that it
> > takes a different syntax than vcbuild.  It provides vcupgrade to convert
> > the .vcproj files into .vcxproj files but does not convert /sln files.
> > devenv does but that is not in the SDK and must be included with the
> > full Visual Basic I am guessing.  So, the instructions said to manually
> > edit the .sln files to use 2010 instead of 2008 and reference .vcxproj
> > files instead of .vcproj files.  So, I ran vcupgrade on redc.vcproj,
> > edited redc.sln and tried again.  Same failure message about
> > vcbuild.exe.
> >
> >   
> I guess it won't work this way, or it will take too much time to make it 
> work.
> > I then looked more closely at the .sln file and it looked like it was
> > merely specifying the build environment options which are no longer
> > necessary with msbuild using the -p:platform= parameter (or so I read)
> > so I tried to simply do msbuild -p:platform=X64 redc.vcxproj.  That
> > complained about not finding python.  So it looks like python is called
> > in generate.bat.  I installed python and it failed again - python was
> > not in the path.  So I added it to the path, opened an new SDK shell and
> > tried again.  Now I get:
> >
> > C:\Users\Administrator\Downloads\spice\spice-0.8.1\client\windows>msbuild -p:platform=X64 redc.vcxproj
> > Microsoft (R) Build Engine Version 4.0.30319.1
> > [Microsoft .NET Framework, Version 4.0.30319.1]
> > Copyright (C) Microsoft Corporation 2007. All rights reserved.
> >
> > Build started 7/4/2011 8:07:48 PM.
> > Project "C:\Users\Administrator\Downloads\spice\spice-0.8.1\client\windows\redc.vcxproj" on node 1 (default targets).
> > InitializeBuildStatus:
> >   Touching "D:\Binaries\x64\Win7\X64\Release\redc.unsuccessfulbuild".
> > CustomBuild:
> >   Generating demarshaller
> >     File "..\..\spice_codegen.py", line 200
> >       print "No changes to %s" % dest_file
> >                              ^
> >   SyntaxError: invalid syntax
> >     File "..\..\spice_codegen.py", line 200
> >       print "No changes to %s" % dest_file
> >                              ^
> >   SyntaxError: invalid syntax
> > C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(1
> > 51,5): error MSB6006: "cmd.exe" exited with code 1. [C:\Users\Administrator\Dow
> > nloads\spice\spice-0.8.1\client\windows\redc.vcxproj]
> > Done Building Project "C:\Users\Administrator\Downloads\spice\spice-0.8.1\clien
> > t\windows\redc.vcxproj" (default targets) -- FAILED.
> >
> >
> > Build FAILED.
> >
> > "C:\Users\Administrator\Downloads\spice\spice-0.8.1\client\windows\redc.vcxproj
> > " (default target) (1) ->
> > (CustomBuild target) ->
> >   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets
> > (151,5): error MSB6006: "cmd.exe" exited with code 1. [C:\Users\Administrator\D
> > ownloads\spice\spice-0.8.1\client\windows\redc.vcxproj]
> >
> >     0 Warning(s)
> >     1 Error(s)
> >
> > Time Elapsed 00:00:00.65
> >
> > I'm assuming the code is correct and I have done something wrong.  How
> > do I compile the Windows client in my environment? Thanks - John
<snip>
We've made considerable progress.  We do not have VS2008 as we are not a
Windows shop and I assume in my Windows ignorance that that's a paid
licensed product so we'd have track which of us could work on it and
which couldn't so we've tried to make due with just the SDK.  That's
actually working well.

The syntax problems seem to be because we had downloaded python 3.2.  We
removed that and installed Python 2.7 along with pyparsing.  It then
complained it could not find spice/types.h.  I will pass that along in
that it smells like a bug.  The instructions say to set
SPICE_PROTOCOL_DIR but redc.vcproj never references it.  Rather than
fiddle with the code or project file, I simply moved the protocol
directory to where it could find it in the include paths I did see in
redc.vcproj.

That worked a treat.  144 warnings but only one error:

  c:\users\administrator\downloads\spice\spice-0.8.1\client\../common/marshaller.c(499): 
warning C4267: '=' : conversion from 'size_t' to 'uint32_t', 
possible loss of data [C:\Users\Administrator\Downloads\spice\spice-0.8.1\client\windows\redc.vcxproj]


"C:\Users\Administrator\Downloads\spice\spice-0.8.1\client\windows\redc.vcxproj" 
(default target) (1) ->(ClCompile target) ->  ..\application.cpp(2300): error C2065:
 'PACKAGE_VERSION' : undeclared identifier [C:\Users\Administrator\Downloads\spice\spice-0.8.1\client\windows\redc.vcxproj]

    144 Warning(s)
    1 Error(s)

Time Elapsed 00:01:31.26

That comes from:
        case SPICE_OPT_VERSION: {
            std::ostringstream os;
            os << argv[0] << " "<< PACKAGE_VERSION << std::endl;
            Platform::term_printf(os.str().c_str());
            return false;
        }

That seems to pull from :
windows/Makefile.in:PACKAGE_VERSION = @PACKAGE_VERSION@

Not being a developer either (as you can probably tell, I'm a pretty
useless management type :)  ) I don't know why this is not being pulled
in - perhaps because I am directly building the vcxproj file rather than
using the sln file although I do not see where that would be in the .sln
file.

This looks like our last hurdle and it does look like there is a real
bug in the redc.vcproj file (or in the documentation depending on how
you look at it!).  Any suggestions on how to fix this last problem?
Thanks - John



More information about the Spice-devel mailing list