xpm on MinGW-ucrt GUI=yes fails

10 views
Skip to first unread message

Henry Garcia

unread,
Apr 18, 2025, 1:30:34 PM4/18/25
to vim...@googlegroups.com
If I disable XPM by using XPM=no, then it works.

MAKE command: make -f Make_cyg_ming.mak CROSS=yes CROSS_COMPILE=x86_64-w64-mingw32- UNDER_CYGWIN=yes STATIC_STDCPLUS=yes GUI=yes OLE=yes
Platform: Debian bookworm - AMD64


I tried compiling the latest git release of libxpm with a MinGW-ucrt compiler and it compiles without error. I tried to copying the corresponding libraries and headers into the xpm/x64 directory but it gave a different error message:

Instead of this error message:
/opt/mingw-gcc-14.2.1-ucrt/lib/gcc/x86_64-w64-mingw32/14.2.1/../../../../x86_64-w64-mingw32/bin/ld: xpm/x64/lib/libXpm.a(RdFToI.o):RdFToI.c:(.text+0xf2): undefined reference to `__imp___iob_func'
/opt/mingw-gcc-14.2.1-ucrt/lib/gcc/x86_64-w64-mingw32/14.2.1/../../../../x86_64-w64-mingw32/bin/ld: xpm/x64/lib/libXpm.a(RdFToI.o):RdFToI.c:(.text+0x12f): undefined reference to `__imp___iob_func'
collect2: error: ld returned 1 exit status
make: *** [Make_cyg_ming.mak:1171: gvim.exe] Error 1

It gives this error message:

-Lxpm/x64/lib -lXpm -loleaut32 -lwinmm -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic -lgcc_eh -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic -lole32 -luuid      
/opt/mingw-gcc-14.2.1-ucrt/lib/gcc/x86_64-w64-mingw32/14.2.1/../../../../x86_64-w64-mingw32/bin/ld: gobjx86-64/xpm_w32.o:xpm_w32.c:(.text$LoadXpmImage+0x4d): undefined reference to `XpmReadFileToImage'
/opt/mingw-gcc-14.2.1-ucrt/lib/gcc/x86_64-w64-mingw32/14.2.1/../../../../x86_64-w64-mingw32/bin/ld: gobjx86-64/xpm_w32.o:xpm_w32.c:(.text$LoadXpmImage+0x8e): undefined reference to `XDestroyImage'
collect2: error: ld returned 1 exit status
make: *** [Make_cyg_ming.mak:1171: gvim.exe] Error 1

I suspect the error stems from the other header file in the xpm/include directory: simx.h which does not exist in the release build of libxpm.


def...@gmail.com

unread,
Apr 19, 2025, 12:38:08 PM4/19/25
to vim_dev
That fixes part of it.

It now fails on line 734 of Make_cyg_ming.mak:
#CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
#CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/../include
CFLAGS += -DFEAT_XPM_W32 -I xpm/include

I don't see the logic in using the XPM macro here. The location of the xpm.h header does not change
according to the architecture of the platform: it's always in xpm/include .

For some reason, perhaps because I'm using ccache?, the $(XPM)/../include line is not being picked
up by the compiler (x86_64-w64-mingw32-gcc ver 14.2.1 ). It should. But it's not. It only picks up the
include location if the location is hard coded in as illustrated.

However, when it picks it up it now gives the following error:

-I xpm/include -I yes/../include -O3 -fomit-frame-pointer -freg-struct-return -ffunction-sections -fno-asynchronous-unwind-tables xpm_w32.c -o gobjx86-64/xpm_w32.o
In file included from xpm_w32.c:22:
xpm/include/xpm.h:57:11: fatal error: X11/Xfuncproto.h: No such file or directory
   57 | # include <X11/Xfuncproto.h>
Reply all
Reply to author
Forward
0 new messages