Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 41977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:15:57+00:00 2026-05-10T15:15:57+00:00

Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime,

  • 0

Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008.

So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:15:57+00:00Added an answer on May 10, 2026 at 3:15 pm

    Here are instructions for building Cairo/Cairomm with Visual C++.

    Required:

    • Visual C++ 2008 Express SP1 (now includes SDK)
    • MSYS 1.0

    To use VC++ command line tools, a batch file ‘vcvars32.bat’ needs to be run.

         C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vcvars32.bat 

    ZLib

    Download (and extract) zlib123.zip from http://www.zlib.net/

         cd zlib123     nmake /f win32/Makefile.msc      dir         # zlib.lib is the static library         #         # zdll.lib is the import library for zlib1.dll         # zlib1.dll is the shared library 

    libpng

    Download (and extract) lpng1231.zip from http://www.libpng.org/pub/png/libpng.html

    The VC++ 9.0 compiler gives loads of ‘this might be unsafe’ warnings. Ignore them; this is MS security panic (the code is good).

         cd lpng1231\lpng1231        # for some reason this is two stories deep      nmake /f ../../lpng1231.nmake ZLIB_PATH=../zlib123      dir         # libpng.lib is the static library         #         # dll is not being created 

    Pixman

    Pixman is part of Cairo, but a separate download.

    Download (and extract) pixman-0.12.0.tar.gz from http://www.cairographics.org/releases/

    Use MSYS to untar via ‘tar -xvzf pixman*.tar.gz’

    Both Pixman and Cairo have Makefiles for Visual C++ command line compiler (cl), but they use Gnu makefile and Unix-like tools (sed etc.). This means we have to run the make from within MSYS.

    Open a command prompt with VC++ command line tools enabled (try ‘cl /?’). Turn that command prompt into an MSYS prompt by ‘C:\MSYS\1.0\MSYS.BAT’.

    DO NOT use the MSYS icon, because then your prompt will now know of VC++. You cannot run .bat files from MSYS.

    Try that VC++ tools work from here: ‘cl -?’

    Try that Gnu make also works: ‘make -v’.

    Cool.

         cd     (use /d/... instead of D:)     cd pixman-0.12.0/pixman     make -f Makefile.win32 

    This defaults to MMX and SSE2 optimizations, which require a newish x86 processor (Pentium 4 or Pentium M or above: http://fi.wikipedia.org/wiki/SSE2 )

    There’s quite some warnings but it seems to succeed.

         ls release         # pixman-1.lib  (static lib required by Cairo) 

    Stay in the VC++ spiced MSYS prompt for also Cairo to compile.

    cairo

    Download (and extract) cairo-1.6.4.tar.gz from http://www.cairographics.org/releases/

         cd      cd cairo-1.6.4 

    The Makefile.win32 here is almost good, but has the Pixman path hardwired.

    Use the modified ‘Makefile-cairo.win32’:

         make -f ../Makefile-cairo.win32 CFG=release \             PIXMAN_PATH=../../pixman-0.12.0 \             LIBPNG_PATH=../../lpng1231 \             ZLIB_PATH=../../zlib123 

    (Write everything on one line, ignoring the backslashes)

    It says ‘no rule to make ‘src/cairo-features.h’. Use the manually prepared one (in Cairo > 1.6.4 there may be a ‘src/cairo-features-win32.h’ that you can simply rename):

         cp ../cairo-features.h src/ 

    Retry the make command (arrow up remembers it).

         ls src/release         #         # cairo-static.lib 

    cairomm (C++ API)

    Download (and extract) cairomm-1.6.4.tar.gz from http://www.cairographics.org/releases/

    There is a Visual C++ 2005 Project that we can use (via open & upgrade) for 2008.

         cairomm-1.6.4\MSCV_Net2005\cairomm\cairomm.vcproj 

    Changes that need to be done:

    • Change active configuration to ‘Release’

    • Cairomm-1.0 properties (with right click menu)

             C++/General/Additional Include Directories:              ..\..\..\cairo-1.6.4\src    (append to existing)          Linker/General/Additional library directories:             ..\..\..\cairo-1.6.4\src\release             ..\..\..\lpng1231\lpng1231             ..\..\..\zlib123          Linker/Input/Additional dependencies:                cairo-static.lib libpng.lib zlib.lib msimg32.lib 
    • Optimization: fast FPU code
                 C++/Code generation/Floating point model                 Fast 

    Right click on ‘cairomm-1.0’ and ‘build’. There are some warnings.

         dir cairomm-1.6.4\MSVC_Net2005\cairomm\Release         #         # cairomm-1.0.lib         # cairomm-1.0.dll         # cairomm.def 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Most of the examples I've found deal with Linq to entities, which is not
I recently switched to Visual Studio 2010 and for Intellisense not to take half
For some reason, I trust is for a good one which I fail to
I have a program written in C, which includes 2 functions, one function is
This is the most strangest error ever - Python os.listdir() fails for every directory:
Hello fellow stackoverflowers, Most Ant build files I've seen online involve a clean target
Most C++ users that learned C prefer to use the printf / scanf family
Most of the examples I have seen online have something similar to: FileOutputStream out
Most apps have some kind of preferences or user settings that can be stored
Most of us know that to redirect STDERR to STDOUT we do 2>&1 We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.