lv2 / suil

Library for loading and wrapping LV2 plugin UIs
ISC License
11 stars 5 forks source link

suil 0.10.12 compilation error #17

Closed chenrui333 closed 2 years ago

chenrui333 commented 2 years ago

Trying to build the latest release suil 0.0.12, but got the following compilation error:

  + install /opt/homebrew/Cellar/suil/0.10.12/lib/suil-0/libsuil_cocoa_in_gtk2.dylib (from build/libsuil_cocoa_in_gtk2.dylib)
  ../src/gtk2_in_qt5.cpp:99:5: error: static_cast from 'GdkNativeWindow' (aka 'void *') to 'WId' (aka 'unsigned long long') is not allowed
      static_cast<WId>(gtk_plug_get_id(reinterpret_cast<GtkPlug*>(plug)));
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

  ../src/qt5_in_gtk.cpp:128:31: error: static_cast from 'GdkNativeWindow' (aka 'void *') to 'WId' (aka 'unsigned long long') is not allowed
    const WId            id   = static_cast<WId>(gtk_socket_get_id(s));
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

  Waf: Leaving directory `/private/tmp/suil-20220528-20257-vmmiwl/suil-0.10.12/build'

full build log, https://github.com/Homebrew/homebrew-core/runs/6640500695 relates to https://github.com/Homebrew/homebrew-core/pull/102533

drobilla commented 2 years ago

Sigh. Right. Would have been wise to remember to install Gtk on my Mac again before prepping a release :)

Presumably that needs to be a reinterpret_cast.

chenrui333 commented 2 years ago

Sigh. Right. Would have been wise to remember to install Gtk on my Mac again before prepping a release :)

Yes!

Presumably that needs to be a reinterpret_cast.

Let me give that a try.

chenrui333 commented 2 years ago

Yeah, I tried it out, it works for my build. Thanks!

chenrui333 commented 2 years ago

but it does not work for linux build

  ../src/qt5_in_gtk.cpp:128:73: error: invalid cast from type ‘GdkNativeWindow {aka unsigned int}’ to type ‘WId {aka long long unsigned int}’
     const WId            id   = reinterpret_cast<WId>(gtk_socket_get_id(s));
                                                                           ^
drobilla commented 2 years ago

Bleh, I give up. Back to C casts it is.

Can you try https://github.com/lv2/suil/tree/fix-mac-build ?

chenrui333 commented 2 years ago

checking it now.

chenrui333 commented 2 years ago

I have tested out, the build works fine now. Thanks for the change!

drobilla commented 2 years ago

Great, thanks. Merged as 2d18caf.

chenrui333 commented 2 years ago

Sounds good, thanks for the fix!