Built opt1/opt4 builds on latest VC2008/Vista/DX9

Thought I’d post this up as it took some doing and might be useful. There’s a few issues with this setup:

Latest VC2008
Latest DX9
DX8 never installed
Using MakePanda.bat

Which I’m guessing will become more of an issue for people as we migrate to newer versions in the near future. My fixes are a little hacky but I’m sure they could be written properly going forwards.

  1. Platform SDK has moved
    The windows platform SDK is in a new folder:
    C:\Program Files\Microsoft SDKs\Windows\v6.0A
    So the search for the windows sdk doesn’t work. I modified MakePandaCore.py as follows:

def SdkLocateMSPlatform():
if (sys.platform != “win32”): return
platsdk=“C:\Program Files\Microsoft SDKs\Windows\v6.0A”

I’m sure theres a proper path info for it somewhere

  1. Latest DX9 uses different registry key for SDK dir
    The registry key used to find the DX9 dir has moved so it doesn’t get found. I add to SdkLocateDirectX in MakePandaCore.py as follows:
    SDK[“DX9”] = “c:/Program Files/Microsoft DirectX SDK (March 2009)”

  2. Latest DX9 doesn’t supply dxtrans.h
    This is a problem with Microsoft but unfortunately we have to deal with it. If you use certain bits of directx, the platform sdk file qedit.h fails to compile as the header is missing. The fix can be found here:
    social.msdn.microsoft.com/forums … eaaf68252/
    There is a hacky one where you just edit qedit.h, and a more solid method where you edit the file that includes it in your own code.

  3. link command doesn’t handle spaces in path
    when calling link (and I guess other apps), the command line parameters that specify a path such as c:\progam files\something\somelib.lib don’t wrap the path in quotes. As a result, link would try and compile c:\program.lib in the above case. This is an issue for things like Maya, where maya specific libs are likely to have been stored in the program files dir. The fix: modify makepanda.py so it puts quotes around path such as this in CompileLink:
    cmd = cmd + ’ /DEF:"’ + x + ‘"’

  4. only a maya problem but could arise with other software. maya includes it’s own versions of some dlls, link cg.dll that are incompatible with panda for some reason, which causes exceptions trying to find entry points when running. The solution I went with was to put these dlls next to my panda app so they always got used. Check which dlls get loaded in the output window to make sure everythings coming from where it should be.

  5. alts.lib not found
    For some weird reason, alts.lib (a default library) isn’t found sometimes. I added /nod alts.lib to the link command and all went fine:
    cmd = cmd + " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"

  6. squish not found.
    Not used squish so don’t know why it’s not found - should the lib be provided in the 3rd party libraries? I just disabled squish for my purposes using the --no-squish option.

I can supply my modified makepanda.py and makepandacore.py if it helps - you can diff it with origonal to see the changes.

Still got 1 issue - opt1 bug works with release, but still not debug builds. Looking into that now.

A handy final tip - make sure your virus checker excludes the folders you’re building from/to. Sometimes it’ll make files readonly very briefly and this can cause file access errors due to the build randomly.

  1. That version of the Platform SDK does not work with Panda correctly, if you want to compile everything. There’s only one version of the PlatformSDK that I’ve found to work well, and that is this one:
    microsoft.com/downloads/deta … laylang=en
    That’s why makepandacore is not checking for your path.

2, 3, 4 have already been fixed on latest CVS version of Panda for some time.

  1. I’ve just applied that fix to CVS, thanks. I’ll take your word that it works.

  2. Squish is in the thirdparty packages. You downloaded the 1.6.2 thirdparty packages, right?

Wait a minute, is it “alts.lib” or “atls.lib” ?