at the Bash prompt.cl -DSTANDALONE -D_X86_ lzexpand.c lz32.lib
wget http://kegel.com/wine/winetricks sh winetricks -q psdkwin7 dxsdk_nov2006You should select just the minimum core subset of the platform SDK, or it might not install properly.
Here's the ~/bin/cl script I use:
#!/bin/sh
WINE=${WINE:-wine}
WINEPREFIX=${WINEPREFIX:-$HOME/.wine}
PROGRAMFILES="c:\Program Files"
WSDK="$PROGRAMFILES\Microsoft Visual Studio 9.0"
WPSDK="$PROGRAMFILES\Microsoft SDKs\Windows\v7.0"
WDXSDK="$PROGRAMFILES\Microsoft DirectX SDK (August 2006)"
export WINEPATH="c:\windows;c:\windows\system32;$WSDK\Common7\IDE;$WSDK\VC\bin"
export INCLUDE="$WSDK\VC\include;$WPSDK\Include;$WDXSDK\Include"
export LIB="$WSDK\VC\lib;$WPSDK\Lib;$WDXSDK\Lib\x86"
$WINE cl.exe $@
I constructed this iteratively by starting out with setting no variables,
seeing what cl complained about when I tried to compile/link a program,
using 'find' to locate the missing files in ~/.wine, and adding the
missing directory to the appropriate variable.
Once you've created this, add ~/bin to your PATH, e.g.
PATH=${PATH}:${HOME}/bin
so you can run cl from the commandline without a path.
Try building "hello world" now!
Here are the commands to download and build a sample app (assuming you've installed the SDKS, created ~/bin/cl and put it on your PATH, as described above.) (Note: the same commands can be used in Cygwin on Windows, though there you would append to PATH rather than setting WINEPATH, and you don't need a cl script.)
wget http://www.codesampler.com/source/dx9_hlsl_simple_vs2ps.zip unzip dx9_hlsl_simple_vs2ps.zip cd dx9_hlsl_simple_vs2ps cl dx9_hlsl_simple_vs2ps.cpp user32.lib gdi32.lib d3d9.lib d3dx9.lib wine dx9_hlsl_simple_vs2ps.exe # If it complains about shader model 1_1, edit the .cpp file, change 1_1 to 2_0, and run cl again.