Menu

#50 Compilation error

1.6
closed
nobody
None
2026-03-04
2026-03-04
SweetTyler
No

I hit an error while compiling the latest source code using an alternative Makefile. The original Makefile builds without this issue.

menu.c:99:16: note: ‘menuCallbackProc’ declared here
99 | typedef void (menuCallbackProc)(Widget, XtPointer, XtPointer);
| ^~~~~~~~~~~~~~~~
menu.c:973:27: error: passing argument 5 of ‘createMenuToggle’ from incompatible pointer type [-Wincompatible-pointer-types]
973 | "Smart", 'm', replaceScopeSmartCB, window,
| ^~~~~~~~~~~~~~~~~~~
| |
| void (
)(struct _WidgetRec , WindowInfo , char ) {aka void ()(struct _WidgetRec , struct _WindowInfo , char )}
menu.c:364:41: note: expected ‘menuCallbackProc’ {aka ‘void (
)(struct _WidgetRec , void , void )’} but argument is of type ‘void ()(struct _WidgetRec , WindowInfo , char )’ {aka ‘void ()(struct _WidgetRec , struct _WindowInfo , char )’}
364 | char mnemonic, menuCallbackProc callback, void
cbArg, int set,
| ~~~~~~~~~~~~~~~~~^~~~~~~~
menu.c:210:13: note: ‘replaceScopeSmartCB’ declared here
210 | static void replaceScopeSmartCB(Widget w, WindowInfo *window, caddr_t callData);
| ^~~~~~~~~~~~~~~~~~~

Discussion

  • SweetTyler

    SweetTyler - 2026-03-04

    Here is my Makefile.linux:

    # $Id: Makefile.linux,v 1.14 2006/10/26 02:20:16 tringali Exp $
    CC = gcc
    AR = gcc-ar
    
    # For editres, add -DEDITRES to CFLAGS and -lXmu to LIBS
    # If using a Motif 2.1 compatible library (LessTif, OM) add
    # a '-lXp' in front of the -lXext in LIBS. You also drop the
    # -lXpm from that list.
    # Ensure that the Motif/LessTif headers and libs are found!
    # e.g. you may have to add something like
    #   -I/usr/lesstif/include  to CFLAGS and
    #   -L/usr/lesstif/lib      to LIBS
    #
    # To evaluate an alternative layout for the Replace/Find dialog, add
    # -DREPLACE_SCOPE to the CFLAGS. See the README file for more information.
    #
    # For CDE drag'n'drop support add:
    # CFLAGS+= -DCDE -I/usr/dt/include
    # LIBS+= -L/usr/dt/lib -R/usr/dt/lib -lDtSvc
    #
    PKG_DEPS = x11 xt xft fontconfig
    
    C_OPT_FLAGS = -O3 -flto -fno-semantic-interposition
    C_ARCH_FLAGS = -march=native
    C_VIS_FLAGS = -fvisibility=hidden
    LD_OPT_FLAGS = -flto=auto
    
    WARNINGS = -Wall -Wextra -Wno-unused-parameter
    
    CFLAGS = $(C_OPT_FLAGS) $(C_ARCH_FLAGS) $(C_VIS_FLAGS) $(WARNINGS) \
             -std=gnu99 -DREPLACE_SCOPE -DUSE_LPR_PRINT_CMD \
             $(shell pkg-config --cflags $(PKG_DEPS))
    
    ARFLAGS = -urs
    
    LIBS = $(LD_OPT_FLAGS) -lXm -lXrender -lm -lpthread \
           $(shell pkg-config --libs $(PKG_DEPS))
    
    include Makefile.common
    
     
  • SweetTyler

    SweetTyler - 2026-03-04

    The error has nothing to do with my Makefile. As soon as I add "-DREPLACE_SCOPE" to the original Makefile, the error appears.

     
  • Pyrphoros

    Pyrphoros - 2026-03-04

    Thanks for the info. The issue is fixed now.

     
  • Pyrphoros

    Pyrphoros - 2026-03-04
    • status: open --> closed
     
  • SweetTyler

    SweetTyler - 2026-03-04

    Thank you for the quick fix.

     

Log in to post a comment.

MongoDB Logo MongoDB