0

I'm looking for a way to run latest mono with latest libgdiplus in old Debian. Latest libgdiplus requires new Cairo library.

I tried to compile Cairo using

cd /usr/local/src
tar -xvf pixman-0.38.4.tar.gz
cd pixman-0.38.4
./configure --prefix=/opt/pixman-0.38.4
make
make install
cd /usr/local/src
tar -xvf cairo-1.16.0.tar.xz
cd cairo-1.16.0
export pixman_CFLAGS="-I/opt/pixman-0.38.4/include/pixman-1"
export pixman_LIBS="-L/opt/pixman-0.38.4/lib/ -lpixman-1"
./configure --prefix=/opt/pixman-0.38.4

make

but got error in make about undefined references to pixman_image_composite32, pixman_add_triangles, pixman_image_get_format and pixman_image_get_component_alpha

Making all in . make[4]: Entering directory `/usr/local/src/cairo-1.16.0/test'
CCLD cairo-test-suite

/usr/local/src/cairo-1.16.0/src/.libs/libcairo.so: undefined reference to `pixman_image_composite32'

/usr/local/src/cairo-1.16.0/src/.libs/libcairo.so: undefined reference to `pixman_add_triangles'

/usr/local/src/cairo-1.16.0/src/.libs/libcairo.so: undefined reference to `pixman_image_get_format'

/usr/local/src/cairo-1.16.0/src/.libs/libcairo.so: undefined reference to `pixman_image_get_component_alpha'

How to compile Cairo ? Maybe make still looks to old pixman which is installed in Debian system directory.

Output from ./configure looks correct

cairo (version 1.16.0 [release]) will be compiled with:
The following surface backends:
Image: yes (always builtin)
Recording: yes (always builtin)
Observer: yes (always builtin)
Mime: yes (always builtin)
Tee: no (disabled, use --enable-tee to enable)
XML: no (disabled, use --enable-xml to enable)
Xlib: yes
Xlib Xrender: yes
Qt: no (disabled, use --enable-qt to enable)
Quartz: no (requires CoreGraphics framework)
Quartz-image: no (disabled, use --enable-quartz-image to enable)
XCB: yes
Win32: no (requires a Win32 platform)
OS2: no (disabled, use --enable-os2 to enable)
CairoScript: yes
PostScript: yes
PDF: yes ...

Community
  • 1
  • 1
Andrus
  • 26,339
  • 60
  • 204
  • 378
  • What does `PKG_CONFIG_PATH=/opt/pixman.0.38.4/lib/pkgconfig pkg-config --modversion pixman-1` say? Does it find your pixman installation? Is there a file called `/opt/pixman.0.38.4/lib/pkgconfig/pixman-1.pc`? – Uli Schlachter Dec 31 '19 at 08:27
  • I added this and other export commands. Now make compiles all files but fails with undefined references. How to fix this ? I updated question. – Andrus Jan 01 '20 at 16:21
  • Well... my question was: What is the output of that command? – Uli Schlachter Jan 02 '20 at 08:51
  • Also, is there a file called `/opt/pixman.0.38.4/lib/libpixman-1.so`? This is what your updated command tries to link against, I think (I'm not sure if one can really specify LIBS like that...) – Uli Schlachter Jan 02 '20 at 08:52
  • Output from your command is `0.16.4`. I corrected directory name to `pixman-0.38.4`. `ls /opt/pixman-0.38.4/lib/libpixman-1.so` shows that file exists but make still throws error for those 3 undefined references. `/opt/pixman-0.38.4/lib/pkgconfig/pixman-1.pc` file also exists – Andrus Jan 03 '20 at 09:12
  • Well, okay... that seems correct. I'm out of good ideas then. Bad ideas would include "check how libcairo.so is being linked", i.e. `make -C src && rm src/libcairo.la && make -C src V=1`. This should show the exact command that is used to link cairo and perhaps looking for the word "pixman" in there provides some insight. However, no idea what kind of insight this would be. – Uli Schlachter Jan 03 '20 at 16:43
  • For reference, on my system linking is done via `/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -version-info 11705:0:11703 -no-undefined -o libcairo.la -rpath /usr/local/lib *.lo -lpthread -lpixman-1 -lfontconfig -lfreetype -lfreetype -lpng16 -lz -lxcb-shm -lxcb -lxcb-render -lXrender -lX11 -lX11 -lXext -lz -lz -lz -lrt -lm`. When I run this command by hand in `src/`, it just works. (The actual command does not use `*.lo`, but comments have a length limit.) – Uli Schlachter Jan 03 '20 at 16:45
  • Actually... wait, a second, no! You are building pixman 0.38.4, but pkg-config says it finds pixman 0.16.4. That's the problem. Somehow pkg-config is picking up the wrong `pixman-1.pc` file. I suggest running `pkg-config --debug --modversion pixman-1` and trying to figure out where it finds the incorrect `pixman-1.pc` / why it does not pick up your version in `/opt`. – Uli Schlachter Jan 03 '20 at 16:47
  • `pkg-config --debug --modversion pixman-1` shows that it founds 0.16.4 version in `/usr/lib/pkgconfig/pixman-1.pc` . How to force new Cairo build to use pixman from `/opt/pixman-0.38.4/lib/pkgconfig/pixman-1.pc` ? – Andrus Jan 04 '20 at 10:36
  • Build script in question has `export pixman_CFLAGS="-I/opt/pixman-0.38.4/include/pixman-1"` and `export pixman_LIBS="-L/opt/pixman-0.38.4/lib/ -lpixman-1"` lines but it looks like Cairo build still uses old pixman – Andrus Jan 04 '20 at 10:41
  • I think I remember you having `PKG_CONFIG_PATH=/opt/pixman-0.38.4/lib/pkgconfig/`. With that env var, `pkg-config --modversion pixman-1` should "print the right thing". Can you check with `pkg-config --debug --modversion pixman-1` and then try to build cairo with the same env var (and without your `pixman_*` env vars). – Uli Schlachter Jan 04 '20 at 13:20
  • Thank you, it worked. You may wrote this as answer – Andrus Jan 04 '20 at 17:08
  • Sorry, but no, I cannot. Your original question (before the first edit) said that you already set `$PKG_CONFIG_PATH` to exactly this value. So, setting this variable to this value cannot be the answer to your question. – Uli Schlachter Jan 05 '20 at 12:29
  • I didnt use export command in my script. I thought that in linux setting environment variable will work like in windows without using export. My real issue is that new (64 bpp?) image formats are not supported in Cairo. (I need to re-size images in Mono shopping cart). Unfortunately last Cairo does still support such images. – Andrus Jan 05 '20 at 14:52
  • Cairo compile throws about 4 errors about undefined symbols. I looks that this is because Debian Squeeze has old freetype. I tried to disable freetype support in Cairo using configure switch but in this case more errors occured. I modfied Cairo source files and comment out those few places ( cases in 2 switch statements and or operator in few places). After that I was able to compile Cairo in Squeeze – Andrus Jan 05 '20 at 15:03

0 Answers0