#11 gambatte_qt doesn't build on OpenBSD

v1.0 (example)
closed-fixed
nobody
None
5
2014-09-28
2012-11-19
No

gambatte_qt doesn't build on OpenBSD. (gambatte_sdl works fine, and I've been using it for a while.)

Two issues so far:

- framework/src/audioengines/ossengine.cpp includes <sys/soundcard.h>. OpenBSD has <soundcard.h>. Fixing the path lets this file compile.

- Joystick code is incompatible.

gcc -c -pipe -O2 -fno-wrapv -fomit-frame-pointer -O2 -fno-wrapv -Wall -W -pthread -DHAVE_STDINT_H -DPLATFORM_UNIX -DHAVE_USBHID_H -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/lib/qt4/mkspecs/openbsd-g++4 -I. -I/usr/local/include/X11/qt4/QtCore -I/usr/local/include/X11/qt4/QtGui -I/usr/local/include/X11/qt4/QtOpenGL -I/usr/local/include/X11/qt4 -Iframework/include -Iframework/src/SDL_Joystick/include -I../../common -I../../libgambatte/include -I/usr/X11R6/include -I. -I/usr/local/include -o SDL_sysjoystick.o framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c: In function 'SDL_SYS_JoystickOpen':
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:310: error: too few arguments to function 'hid_start_parse'
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c: In function 'SDL_SYS_JoystickUpdate':
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:443: error: 'struct usb_ctl_report' has no member named 'data'
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:443: warning: comparison between signed and unsigned
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:449: error: too few arguments to function 'hid_start_parse'
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:467: error: 'struct usb_ctl_report' has no member named 'data'
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:475: error: 'struct usb_ctl_report' has no member named 'data'
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:483: error: 'struct usb_ctl_report' has no member named 'data'
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c: In function 'report_alloc':
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:555: warning: passing argument 3 of 'hid_report_size' makes integer from pointer without a cast
framework/src/SDL_Joystick/src/bsd/SDL_sysjoystick.c:566: error: 'struct usb_ctl_report' has no member named 'data'

Discussion

  • sinamas
    sinamas
    2012-12-11

    hi Anthony,
    could you try r363 from SVN and see if that helps?

     
  • Thanks, I can get it running now. Some issues remain:

    g++ -c -I/usr/local/include/X11/qt4 -I/usr/X11R6/include -I/usr/local/include/X11/qt4/QtOpenGL -I/usr/local/include/X11/qt4/QtGui -I/usr/local/include/X11/qt4/QtCore -I/usr/local/lib/qt3/mkspecs/default -I. -Iframework/include -Iframework/src/SDL_Joystick/include -I../../common -I../../libgambatte/include -I/usr/local/
    include -I/usr/local/include/X11/qt3 -o gambattesource.o gambattesource.cpp
    gambattesource.cpp:136: error: reference to 'uint_least32_t' is ambiguous
    /usr/include/stdint.h:76: error: candidates are: typedef __uint_least32_t uint_least32_t
    ../../libgambatte/include/gbint.h:50: error: typedef long unsigned int gambatte::uint_least32_t

    I got around this by specifically saying gambatte::uint_least32_t; see attached patch.

    The build errors unless gambatte_qt is linked with -lSDL and -lossaudio.

    At runtime, the console prints:
    Unable to load library icui18n "Cannot load library icui18n: (File not found)"

    The library does exist as /usr/local/lib/libicui18n.a and /usr/local/lib/libicui18n.so.5.0.

    Console prints:
    /dev/dsp: No such file or directory
    If I specify /dev/audio in the sound settings instead, audio plays fine. It would be nice if this could be autodetected.

     
  • fix ambiguous type names

     
  • sinamas
    sinamas
    2012-12-15

    > g++ -c -I/usr/local/include/X11/qt4 -I/usr/X11R6/include
    > -I/usr/local/include/X11/qt4/QtOpenGL -I/usr/local/include/X11/qt4/QtGui
    > -I/usr/local/include/X11/qt4/QtCore -I/usr/local/lib/qt3/mkspecs/default
    > -I. -Iframework/include -Iframework/src/SDL_Joystick/include -I../../common
    > -I../../libgambatte/include -I/usr/local/
    > include -I/usr/local/include/X11/qt3 -o gambattesource.o
    > gambattesource.cpp
    > gambattesource.cpp:136: error: reference to 'uint_least32_t' is ambiguous
    > /usr/include/stdint.h:76: error: candidates are: typedef __uint_least32_t
    > uint_least32_t
    > ../../libgambatte/include/gbint.h:50: error: typedef long
    > unsigned int gambatte::uint_least32_t

    you're missing -DHAVE_STDINT_H for some reason, which is why it fails.
    did you mess with the defines in the framework.pro file at all?

    > The build errors unless gambatte_qt is linked with -lSDL and -lossaudio
    what linker errors do you get if you omit -lSDL?

    > Unable to load library icui18n "Cannot load library icui18n: (File not
    > found)"
    no idea where this comes from.

    thanks for the feedback. have never tried to build on OpenBSD myself. hopefully we can get it building vanilla with your help. without regular building on OpenBSD I cannot promise it won't break again though. should really have some kind of automated building for this kind of stuff.

     
  • > you're missing -DHAVE_STDINT_H for some reason, which is why it fails.
    > did you mess with the defines in the framework.pro file at all?

    Hm, I can no longer reproduce. Maybe I passed CFLAGS to make via the command line, and that overwrote it (but when I just tried that, it still didn't happen). Probably a local issue.

    > > The build errors unless gambatte_qt is linked with -lSDL and -lossaudio
    > what linker errors do you get if you omit -lSDL?

    SDL_sysjoystick.o(.text+0x10e): In function `SDL_SYS_JoystickClose':
    : undefined reference to `hid_dispose_report_desc'
    SDL_sysjoystick.o(.text+0x1e0): In function `SDL_SYS_JoystickUpdate':
    : undefined reference to `hid_start_parse'
    SDL_sysjoystick.o(.text+0x202): In function `SDL_SYS_JoystickUpdate':
    : undefined reference to `hid_get_item'
    SDL_sysjoystick.o(.text+0x23b): In function `SDL_SYS_JoystickUpdate':
    : undefined reference to `hid_get_data'
    SDL_sysjoystick.o(.text+0x2b8): In function `SDL_SYS_JoystickUpdate':
    : undefined reference to `hid_get_data'
    SDL_sysjoystick.o(.text+0x32d): In function `SDL_SYS_JoystickUpdate':
    : undefined reference to `hid_end_parse'
    SDL_sysjoystick.o(.text+0x351): In function `SDL_SYS_JoystickUpdate':
    : undefined reference to `hid_get_data'
    SDL_sysjoystick.o(.text+0x49c): In function `SDL_SYS_JoystickOpen':
    : undefined reference to `hid_get_report_desc'
    SDL_sysjoystick.o(.text+0x4f0): In function `SDL_SYS_JoystickOpen':
    : undefined reference to `hid_report_size'
    SDL_sysjoystick.o(.text+0x58d): In function `SDL_SYS_JoystickOpen':
    : undefined reference to `hid_start_parse'
    SDL_sysjoystick.o(.text+0x5e4): In function `SDL_SYS_JoystickOpen':
    : undefined reference to `hid_get_item'
    SDL_sysjoystick.o(.text+0x63f): In function `SDL_SYS_JoystickOpen':
    : undefined reference to `hid_usage_in_page'
    SDL_sysjoystick.o(.text+0x72d): In function `SDL_SYS_JoystickOpen':
    : undefined reference to `hid_end_parse'
    SDL_sysjoystick.o(.text+0x9cf): In function `SDL_SYS_JoystickInit':
    : undefined reference to `hid_init'
    collect2: ld returned 1 exit status

    > thanks for the feedback. have never tried to build on OpenBSD myself.
    > hopefully we can get it building vanilla with your help. without regular
    > building on OpenBSD I cannot promise it won't break again though. should
    > really have some kind of automated building for this kind of stuff.

    I maintain OpenBSD's gambatte package. Whenever you release a tarball, I can at least make sure that builds. Can't commit to constantly follow SVN, although I do check from time to time.

     
  • sinamas
    sinamas
    2012-12-16

    try -lusbhid

     
  • -lusbhid works.

     
  • sinamas
    sinamas
    2014-09-28

    • status: open --> closed-fixed
    • Group: --> v1.0 (example)