Hopefully, Inkscape will compile right out of the box. If it doesn't, well that's what this page is for.
Jot down notes, questions, findings, tips, etc. here on things you run into. It's a good idea to make mention of what version of the code you're trying to compile, the distribution you're running, and other such information that might be pertinent.
If legitimate bugs are found or patches developed, please move them to the tracker at Sourceforge rather than inlining them here.
OS & Distribution Specific
- [[Fedore Core 2][CompilingFC2]]
- Windows Win32Port [Windows Win32Port]
Specific Package Problems + Solutions
If you have to compile and install GtkMM from source, you may find an error like this when trying to compile Inkscape:
checking for gtk+-2.0 >= 2.0.0 libxml-2.0 >= 2-2.4.24 sigc++-1.2 gtkmm-2.0... Package gtkmm-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtkmm-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtkmm-2.0' found
A solution suggested by Ishmal is to set the PKG_CONFIG_PATH variable as so:
setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/usr/lib/pkgconfig
Boehm Garbage Collector Dependency
If your distro does not have a package available (like many don't, ie, Fedora Core 2), then download source from here:
Then configure it with the command:
$ ./configure --enable-cplusplus $ make; make install
Also, if searching for a package for GC, the name of it is sometimes:
- boehm-gc (on Gentoo)
Plain vanilla compilation is done as documented in INSTALL; ./autogen.sh (optionally); ./configure; make; su && make test; make install (optional). See INSTALL for more on that.
But if you're going to be doing a lot of development, there's some tricks and techniques you should know, to get best results.
- Turn off optimization
- Use ccache for faster compilation
- Set up a separate build directory (nice for testing both gcc and g++, or cross compiling)
- Use the -j N flag to optimize for the number of processors in your machine, with N = 1 + no. proc's
Example: Setting up both gcc and g++ build environments (in separate tree), and using ccache for faster compilations on a dual-processor machine, with no optimization, assuming /bin/bash:
mkdir build-gcc build-g++ cvs checkout inkscape cd inkscape libtoolize --copy --force ./autogen.sh cd ../build-gcc CFLAGS='-g -O0 -Wall' CC='ccache gcc' ../inkscape/configure cd ../build-g++ CXXFLAGS='-g -O0 -Wall' CXX='ccache g++' ../inkscape/configure cd build-gcc && make -j 3 cd build-g++ && make -j 3
Turning off just optimization (which can produce strange results in debuggers):
export CC=g++ export CXXFLAGS='-g -O0 -Wall' export CFLAGS='-g -O0 -Wall' ./configure