brummer10 / Mamba

Virtual Midi keyboard and Midi Live Looper for Jack Audio Connection Kit
BSD Zero Clause License
76 stars 5 forks source link

libxputty/xputty/header/xwidget-platform.h:84:1: error: unknown type name 'Display' #56

Open yurivict opened 6 months ago

yurivict commented 6 months ago

Build fails:

c++: warning: optimization flag '-fstrength-reduce' is not supported [-Wignored-optimization-argument]
c++: warning: optimization flag '-fschedule-insns' is not supported [-Wignored-optimization-argument]
In file included from MidiKeyBoard.cpp:22:
In file included from ./MidiKeyBoard.h:55:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidgets.h:40:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/widgets/xbutton.h:26:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xputty.h:200:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget.h:34:
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:84:1: error: unknown type name 'Display'
   84 | Display *os_open_display(char *display_name);
      | ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:91:23: error: unknown type name 'Display'
   91 | void os_close_display(Display *dpy);
      |                       ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:101:1: error: unknown type name 'Window'
  101 | Window os_get_root_window(Xputty *main, int flag);
      | ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:119:39: error: unknown type name 'Window'
  119 | void os_translate_coords(Widget_t *w, Window from_window, Window to_window,
      |                                       ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:119:59: error: unknown type name 'Window'
  119 | void os_translate_coords(Widget_t *w, Window from_window, Window to_window,
      |                                                           ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:147:21: error: unknown type name 'Display'
  147 | void os_move_window(Display *dpy, Widget_t *w, int x, int y);
      |                     ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:156:23: error: unknown type name 'Display'

Version: 2.6 FreeBSD 14.0

brummer10 commented 6 months ago

Hi @yurivict

Hopefully that is fixed now with the latest commit. Let me know please if it works now for BSD/clang.

yurivict commented 5 months ago

The build of the last tag 3a814f5 fails:

===>  Building for mamba-2.6
for         
with        cc
using       gold
and         xxd -i
gmake[1]: warning: -j1 forced in submake: resetting jobserver mode.
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
 Building object file build/MidiKeyBoard.o 
c++: warning: optimization flag '-fstrength-reduce' is not supported [-Wignored-optimization-argument]
c++: warning: optimization flag '-fschedule-insns' is not supported [-Wignored-optimization-argument]
In file included from MidiKeyBoard.cpp:22:
./MidiKeyBoard.h:55:10: fatal error: 'xwidgets.h' file not found
   55 | #include "xwidgets.h"
      |          ^~~~~~~~~~~~
1 error generated.
gmake[1]: *** [Makefile:156: build/MidiKeyBoard.o] Error 1
yurivict commented 5 months ago

After adding a few include paths, it fails to find the header:

In file included from MidiKeyBoard.cpp:22:
In file included from ./MidiKeyBoard.h:55:
In file included from /usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/xwidgets.h:40:
In file included from /usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/widgets/xbutton.h:26:
In file included from /usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/xputty.h:210:
/usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/xpngloader.h:109:10: fatal error: 'xresources.h' file not found
  109 | #include "xresources.h"
      |          ^~~~~~~~~~~~~~
1 error generated.

xresources.h isn't in the source tree.

yurivict commented 5 months ago

These include paths were missing:

CXXFLAGS+=      -I${WRKSRC}/libxputty/xputty/header \
                -I${WRKSRC}/libxputty/xputty/header/widgets
brummer10 commented 5 months ago

for
with cc using gold and xxd -i

That's the issue, it should read for FreeBSD to set the needed flags and include path. I've pushed a Fix for it now, please check if the last commit works now for you.

yurivict commented 5 months ago

The revision 4b6bd9c fails:

===>  Building for mamba-2.5
Makefile:2: libxputty/Build/Makefile.base: No such file or directory
gmake: *** No rule to make target 'libxputty/Build/Makefile.base'.  Stop.
brummer10 commented 5 months ago

you must run git submodule update --init --recursive before make.