# Asimage, libAfterImage, X11 implicit function declaration and conversion errors in compiling from source

**URL:** <https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006>\
**Category:** Newbie\
**Tags:** build, root\
**Created:** [September 29, 2026, 8:51pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006 "2026-09-29T20:51:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbauer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@sbauer](https://root-forum.cern.ch/u/sbauer)\
**Post date:** [September 29, 2026, 8:51pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/1 "2026-09-29T20:51:10Z")

</div>

* * *

_ROOT Version:_ 6.40.04 for linuxx8664gcc  
_Platform:_ Fedora 44 on WSL 2 on Windows 11 25H2  
_Compiler:_ Cling (i think?)

* * *

Hello, I am trying to compile Root from source on Fedora 44 through WSL on Windows 11. I cloned the latest stable release from Github and ran the following commands to initialize cmake (make).

`root_src` is a folder where Root was cloned into. `rootinstall` is a folder in the same parent directory as `root_src` and is where I want to build/install Root to. `pandora` is my user in Fedora.  
_Some of the cmake options I found online to possibly alleviate the error._

```auto
cmake -Dbuiltin_vdt=ON -Dfail-on-missing=ON -DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" -DCMAKE_INSTALL_PREFIX=../rootinstall ../root_src

```

This finishes and I then execute,

```auto
cmake --build .

```

The build/compiling process proceeds until 88% and I receive the following error that I have truncated to a few lines, (the untruncated error is listed at the bottom of this post and has similar flags throughout).

```auto
[88%] Building C object graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/asfont.c.o
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c: In function ‘open_X11_font_int’:
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:252:20: warning: implicit declaration of function ‘XLoadQueryFont’; did you mean ‘X_QueryFont’? [-Wimplicit-function-declaration]
  252 | if( (xfs = XLoadQueryFont( fontman->dpy, font_string )) == NULL )
      | ^ ~~~~~~~~~~~~~
      | X_QueryFont
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:252:18: error: assignment to ‘XFontStruct *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  252 | if( (xfs = XLoadQueryFont( fontman->dpy, font_string )) == NULL )
      | ^
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:263:9: warning: implicit declaration of function ‘XFreeFont’ [-Wimplicit-function-declaration]
  263 | XFreeFont( fontman->dpy, xfs );
      | ^ ~~~~~~~~'''
REST OF THE ERROR
'''
gmake[2]: *** [graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/build.make:107: graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/asfont.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:57159: graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

```

I have searched and tried to use the build in libAfterImage package with no avail. I also tried to compile from source on Ubuntu and Debian with similar errors.  
Any help is appreciated!  
Thanks

* * *

* * *

* * *

Below, the full error from compiling.

```auto
[88%] Building C object graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/asfont.c.o
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c: In function ‘open_X11_font_int’:
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:252:20: warning: implicit declaration of function ‘XLoadQueryFont’; did you mean ‘X_QueryFont’? [-Wimplicit-function-declaration]
  252 | if( (xfs = XLoadQueryFont( fontman->dpy, font_string )) == NULL )
      | ^ ~~~~~~~~~~~~~
      | X_QueryFont
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:252:18: error: assignment to ‘XFontStruct *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  252 | if( (xfs = XLoadQueryFont( fontman->dpy, font_string )) == NULL )
      | ^
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:263:9: warning: implicit declaration of function ‘XFreeFont’ [-Wimplicit-function-declaration]
  263 | XFreeFont( fontman->dpy, xfs );
      | ^ ~~~~~~~~
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c: In function ‘load_X11_glyph_range’:
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:769:21: warning: implicit declaration of function ‘XCreatePixmap’; did you mean ‘X_CreatePixmap’? [-Wimplicit-function-declaration]
  769 | p = XCreatePixmap( dpy, DefaultRootWindow(dpy), total_width, height, 1 );
      | ^ ~~~~~~~~~~~~
      | X_CreatePixmap
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:774:31: warning: implicit declaration of function ‘XCreateGC’; did you mean ‘X_CreateGC’? [-Wimplicit-function-declaration]
  774 | *gc = XCreateGC( dpy, p, GCFont|GCForeground, &gcv);
      | ^ ~~~~~~~~
      | X_CreateGC
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:774:29: error: assignment to ‘GC’ {aka ‘XGCValues *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  774 | *gc = XCreateGC( dpy, p, GCFont|GCForeground, &gcv);
      | ^
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:776:25: warning: implicit declaration of function ‘XSetForeground’; did you mean ‘XNForeground’? [-Wimplicit-function-declaration]
  776 | XSetForeground( dpy, *gc, 1 );
      | ^ ~~~~~~~~~~~~~
      | XNForeground
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:777:17: warning: implicit declaration of function ‘XFillRectangle’; did you mean ‘X_PolyRectangle’? [-Wimplicit-function-declaration]
  777 | XFillRectangle( dpy, p, *gc, 0, 0, total_width, height );
      | ^ ~~~~~~~~~~~~~
      | X_PolyRectangle
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:789:25: warning: implicit declaration of function ‘XDrawImageString16’ [-Wimplicit-function-declaration]
  789 | XDrawImageString16( dpy, p, *gc, pen_x-offset, xfs->ascent, &test_char, 1 );
      | ^ ~~~~~~~~~~~~~~~~~
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:795:23: warning: implicit declaration of function ‘XGetImage’; did you mean ‘X_GetImage’? [-Wimplicit-function-declaration]
  795 | xim = XGetImage( dpy, p, 0, 0, total_width, height, 0xFFFFFFFF, ZPixmap );
      | ^ ~~~~~~~~
      | X_GetImage
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:795:21: error: assignment to ‘XImage *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  795 | xim = XGetImage( dpy, p, 0, 0, total_width, height, 0xFFFFFFFF, ZPixmap );
      | ^
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:796:17: warning: implicit declaration of function ‘XFreePixmap’; did you mean ‘X_FreePixmap’? [-Wimplicit-function-declaration]
  796 | XFreePixmap( dpy, p );
      | ^ ~~~~~~~~~~
      | X_FreePixmap
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c: In function ‘load_X11_glyphs’:
/home/pandora/root_src/graf2d/asimage/src/libAfterImage/asfont.c:993:17: warning: implicit declaration of function ‘XFreeGC’; did you mean ‘X_FreeGC’? [-Wimplicit-function-declaration]
  993 | XFreeGC( dpy, gc );
      | ^ ~~~~~~
      | X_FreeGC
gmake[2]: *** [graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/build.make:107: graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/asfont.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:57159: graf2d/asimage/src/libAfterImage/CMakeFiles/libAfterImage.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

```

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [September 30, 2026, 5:44am UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/2 "2026-09-30T05:44:54Z")

</div>

Hi,

I have no experience with WSL on Windows, but seems to be you missing some important X11 headers in your environment. Try to install developer packages first like:

```auto
sudo apt install -y libx11-dev libxpm-dev libxft-dev libxext-dev

```

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![sbauer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@sbauer](https://root-forum.cern.ch/u/sbauer)\
**Post date:** [September 30, 2026, 4:40pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/3 "2026-09-30T16:40:57Z")

</div>

Hello Sergey,

Thank you for your response. I have installed seemingly all dependencies listed as requirements for compiling Root from source, including `libX11-devel libXpm-devel libXft-devel libXext-devel`. I still get the same implicit function declaration and conversion errors as before.

* * *

When I run

```auto
cmake -Dbuiltin_vdt=ON -Dfail-on-missing=ON -DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" -DCMAKE_PREFIX_PATH="/etc/X11" -DCMAKE_INSTALL_PREFIX=../rootinstall ..
/root_src

```

I get,

```auto
-- Looking for X11
-- Found X11: /usr/include found components: Xpm Xft Xext
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found

```

and later,

```auto
-- X11_INCLUDE_DIR: /usr/include
-- X11_LIBRARIES: /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- X11_Xpm_INCLUDE_PATH: /usr/include
-- X11_Xpm_LIB: /usr/lib64/libXpm.so
-- X11_Xft_INCLUDE_PATH: /usr/include
-- X11_Xft_LIB: /usr/lib64/libXft.so
-- X11_Xext_INCLUDE_PATH: /usr/include
-- X11_Xext_LIB: /usr/lib64/libXext.so

```

I’m pretty sure I have all the packages but cmake is not able to find them maybe?

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [September 30, 2026, 4:50pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/4 "2026-09-30T16:50:49Z")

</div>

Check if you have installed of the below (the third is for the “optionals” but install them just in case), or just run all these, to be sure:

```auto
sudo dnf install -y git make cmake gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel python openssl-devel xrootd-client-devel xrootd-libs-devel

sudo dnf install -y tbb

sudo dnf install -y gcc-gfortran pcre-devel mesa-libGL-devel mesa-libGLU-devel glew-devel ftgl-devel mysql-devel fftw-devel cfitsio-devel graphviz-devel libuuid-devel avahi-compat-libdns_sd-devel openldap-devel python-devel python3-numpy libxml2-devel gsl-devel readline-devel qt5-qtwebengine-devel R-devel R-Rcpp-devel R-RInside-devel

```

(I used these to compile ROOT in a “real”, fresh Fedora with Gnome, but did not test in WSL)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [October 1, 2026, 8:59am UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/5 "2026-10-01T08:59:30Z")

</div>

[Try](https://github.com/root-project/root-docker/blob/master/fedora/packages): `sudo dnf install -y libAfterImage-devel`

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [October 1, 2026, 10:54am UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/6 "2026-10-01T10:54:01Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> sudo dnf install -y libAfterImage-devel

Recent ROOT uses only builtin version of `libAfterImage`.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [October 1, 2026, 4:16pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/7 "2026-10-01T16:16:42Z")

</div>

Sergey is right. Only ROOT 6.32 and older could use the system-provided “libAfterImage”.

@sbauer After installing any additional “devel” packages, make sure you completely remove your “root\_build” directory (before you try to configure your ROOT again).  
This looks strange to me: `-DCMAKE_PREFIX_PATH="/etc/X11"`  
When the configuration ends, it prints a line which begins with “`-- Enabled support for:`”. Do you have “`x11`” in this list (see also the “`features=`” line in the newly generated “`bin/root-config`” file, or try “`grep x11 CMakeCache.txt`”)?

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [October 1, 2026, 9:53pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/8 "2026-10-01T21:53:33Z")

</div>

Maybe try adding `#include <X11/Xlib.h>` on top of this file, and check that it exists in the system and it has the XLoadQueryFont definition visible?

---

<div class="post-metadata">

**Author:** ![sbauer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@sbauer](https://root-forum.cern.ch/u/sbauer)\
**Post date:** [October 2, 2026, 8:58pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/9 "2026-10-02T20:58:21Z")

</div>

The configuration enables support for the following which includes X11 and asimage,

```auto
Enabled support for: asimage asimage_tiff builtin_clang builtin_cling builtin_civetweb builtin_llvm builtin_openui5 builtin_vdt check_connection clad curl dataframe davix fitsio gdml geom http imt opengl pyroot roofit root7 runtime_cxxmodules shared spectrum sqlite ssl thisroot_scripts tmva tmva-cpu tmva-cudnn tpython vdt webgui x11 xml xrootd

```

Additionally, the `features=` line in `root-config` includes asimage and x11. And `grep x11 CMakeCache.txt`, also for asimge, are `bool=ON`.

Will build again and see what happens. Takes me a while cause I get errors when multithreading, so single core I go for the moment.

@ferhue What file should I make sure that include statement is in?

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [October 2, 2026, 9:51pm UTC](https://root-forum.cern.ch/t/asimage-libafterimage-x11-implicit-function-declaration-and-conversion-errors-in-compiling-from-source/65006/10 "2026-10-02T21:51:58Z")

</div>

asfont.c
