Difference between revisions of "Compiling Inkscape on Windows 32-bit"

From Inkscape Wiki
Jump to navigation Jump to search
Line 4: Line 4:


Ishmal provides a complete set of compiler and libraries on hie website. You can get all packages from http://inkscape.modevia.com/win32libs/ . Writing this chapter (February 7th 2007) those are:
Ishmal provides a complete set of compiler and libraries on hie website. You can get all packages from http://inkscape.modevia.com/win32libs/ . Writing this chapter (February 7th 2007) those are:
- the mingw compiler version 4.1 http://inkscape.modevia.com/win32libs/mingw411-060525.zip
* the mingw compiler version 4.1 http://inkscape.modevia.com/win32libs/mingw411-060525.zip
- the gtk libraries version 2.10 http://inkscape.modevia.com/win32libs/gtk210-070125.7z
* the gtk libraries version 2.10 http://inkscape.modevia.com/win32libs/gtk210-070125.7z
The configuration files expect the packages in specific directories:
The configuration files expect the packages in specific directories:
- the compiler C:\MinGW
* the compiler C:\MinGW
- the libraries C:\gtk210
* the libraries C:\gtk210


Now you step into the Inkscape source directory:
Now you step into the Inkscape source directory:
Line 27: Line 27:
There is also a [[Win32 installer]]
There is also a [[Win32 installer]]


=== Create the Setup package for Win32 ===
To create the setup package you need the NSIS installer on your PC. Get that from http://nsis.sf.net .
You have successfully built Inkscape and everything is in the ...\Inkscape\Inkscape\ directory.
Open the ...\Inkscape\packaging\win32\inkscape.nsi using the NSIS program and compile the package. Sooo easy :-)





Revision as of 17:42, 7 February 2007

See the Win32 Build ticket for some info.

Inkscape under Windows

Ishmal provides a complete set of compiler and libraries on hie website. You can get all packages from http://inkscape.modevia.com/win32libs/ . Writing this chapter (February 7th 2007) those are:

The configuration files expect the packages in specific directories:

  • the compiler C:\MinGW
  • the libraries C:\gtk210

Now you step into the Inkscape source directory:

   ...\> cd ...\inkscape

set up the environment variables

   ...\> mingwenv.bat

build the magic make replacement:

   ...\> g++ buildtool.cpp -o btool

start the build proccess:

   ...\> btool

Now you should have you fresh Inkscape in the ...\Inkscape\Inkscape directory.

We will update this page soon with information on how to build Inkscape on the Win32 platform. In the meantime, there are some fairly complete notes on how to build the current package with either Mingw on Windows, or a cross-compiler on Linux, at http://inkscape.modevia.com/win32_inkscape_org/win32buildnotes.html (note: http://inkscape.modevia.com/win32libs/ seems to have more complete and up-to-date library packages).

There is also a Win32 installer

Create the Setup package for Win32

To create the setup package you need the NSIS installer on your PC. Get that from http://nsis.sf.net . You have successfully built Inkscape and everything is in the ...\Inkscape\Inkscape\ directory. Open the ...\Inkscape\packaging\win32\inkscape.nsi using the NSIS program and compile the package. Sooo easy :-)


A Note from Jon about UNICODE on Win32

Actually, Microsoft themselves never use _UNICODE, nor it's 'evil' friends TCHAR and _T. If it is used, it results in a binary that can not be run on Windows 95/98/ME. It is more of a "Windows NT only" define.

Microsoft applications like MS Office have been pure 16-bit Unicode internally for years now. Also remember that BSTRs in Win32 are required to have 16-bit Unicode data. So for any COM access on a Win32 box running Win9x/ME 'multibyte' or '8-bit' COM calls convert all ANSI data to Unicode once you pass things in. To avoid this, Microsoft just keeps data 16-bit Unicode and then translates to local ANSI codepage only when data needs to be passed directly to a Win32 call.

To help developers, Microsoft finally made public their API they had been using. It's "The Microsoft Layer for Unicode".

Although that simplifies things, it's not required. I've done Win32 programs that are 16-bit Unicode and run on Windows 95/98/ME with no problems years before they released that.

Soo.... _UNICODE can't be used as it makes your binary unusable on Win9x/ME. Then it turns out that TCHAR and _T can't be used either. (Oh, and MS can't really use them, since Office does run on Win9x/ME). So just explicitly use some 16-bit datatype for chars. Microsoft is misleading in their documentation when they state that wchar_t is 16-bit. Most other platforms (including Mac OS, Linux, Solaris, BSD, etc) follow the language standard's recommendation and make it 32-bit. So it is best to avoid wchar_t for any real cross-platform code.

So, some general guidelines are:

  • Never define _UNICODE
  • Don't use _T
  • Don't use TCHAR
  • Don't use wchar_t
  • Use some explicit 16-bit type for characters/strings

So then it's a simple matter of converting data from the standard UTF-8 GTK+ data to UTF-16 data before passing to Win32-land.

The result? A single binary that executes properly on both Win9X/ME and WinNT/2K/XP, including full and proper font and filename support.

And, as I've mentioned before, I've actually achieved this for a few different shipping products and projects.

-- [[[JonCruz]] Jon C]

CVS and Windows

If you want to do developer CVS access to SF on windows, I'd heartily recommend TortoiseCVS. It has the SSH stuff built into it so you dont have to mess about with putty, and it integrates right into explorer, so CVS becomes just an extension of the file commands. get it from http://tortoisecvs.sourceforge.net/

John