[cairo] Errors building Cairo and Pixman under Cygwin
Tor Lillqvist
tml at iki.fi
Sun Apr 12 00:14:47 PDT 2009
> /bin/sh: cl: command not found
cl is the Microsoft C and C++ compiler. You need to set your PATH so
that it is found. If you installed Visual Studio, you will find in
Start Menu under Microsoft Visual Studio 2008 > Visual Studio Tools >
Visual Studio 2008 Command Prompt. That opens a cmd.exe window with
environment variables preset to find the compiler, and so that the
compiler finds its bundled headers and libraries.
But what you presumably want is to use the Microsoft compiler from
some Unix-like shell, so that is not directly useful. Take note of
what Visual Studio -specific environment variables. Using the "set"
command, you will typically see something like:
[...]
INCLUDE=C:\Program Files\Microsoft Visual Studio
9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visual Studio
9.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.0\include;
LIB=C:\Program Files\Microsoft Visual Studio
9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio
9.0\VC\LIB;C:\Program Files\Microsoft SDKs\Windows\v7.0\lib;
[...]
Path=C:\Program Files\Microsoft Visual Studio
9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio
9.0\VC\BIN;C:\Program Files\Microsoft Visual Studio
9.0\Common7\Tools;C:\Program Files\Microsoft Visual Studio
9.0\Common7\Tools\bin;[...]
Now all you need is to duplicate that in your Unix-like shell, and the
"cl" command will work. Personally I use this shell function in my
/etc/bash_profile:
function usemsvs9() {
PATH="/opt/MSVS9/VC/bin:/opt/MSVS9/Common7/IDE:/opt/MSVS9/Common7/Tools:/opt/winsdk61/Bin:$PATH"
export INCLUDE='c:\opt\MSVS9\VC\include;c:\opt\winsdk61\Include'
export LIB='c:\opt\MSVS9\VC\lib;\opt\winsdk61\Lib'
}
(where /opt/MSVS9 is a "junction" for C:\Program Files\Microsoft
Visual Studio 9.0 , easier to type, and /opt/winsdk61 is where I have
the Windows SDK 6.1 installed.)
> Why does it have to be so difficult?
New things always appear difficult at first.
--tml
More information about the cairo
mailing list