Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile app with go run -tags wayland #278

Closed
andydotxyz opened this issue Mar 29, 2020 · 7 comments
Closed

Cannot compile app with go run -tags wayland #278

andydotxyz opened this issue Mar 29, 2020 · 7 comments

Comments

@andydotxyz
Copy link
Contributor

I cannot compile for wayland, error is:

# github.com/go-gl/glfw/v3.3/glfw
In file included from ./glfw/src/internal.h:190,
                 from ./glfw/src/context.c:30,
                 from ../../../../../pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/c_glfw.go:4:
./glfw/src/wl_platform.h:59:10: fatal error: wayland-xdg-shell-client-protocol.h: No such file or directory
   59 | #include "wayland-xdg-shell-client-protocol.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I have tried running the wayland generate script, however that only creates the files for wayland-idle-inhibit-, wayland-pointer-constraints and wayland-relative-pointer. I cannot figure out how the additional files referenced by this project are created or found?

Compiling against v3.3.1 - 0a49ef0a00baa3ab520ddc452f0e3b1e099c5589

@andydotxyz andydotxyz changed the title Cannot compile app with tags wayland Cannot compile app with go run -tags wayland Mar 29, 2020
@andydotxyz
Copy link
Contributor Author

Same result without modules enabled btw

@pwaller
Copy link
Member

pwaller commented Apr 19, 2020

Looks like they are generated here if you'd like to take a crack at fixing them. Just add a few more, I think:

wayland-scanner code $TMP_CLONE_DIR/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.c
wayland-scanner client-header $TMP_CLONE_DIR/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.h

And the ones you need:

#include "wayland-xdg-shell-client-protocol.h"
#include "wayland-xdg-decoration-client-protocol.h"
#include "wayland-viewporter-client-protocol.h"
#include "wayland-relative-pointer-unstable-v1-client-protocol.h"
#include "wayland-pointer-constraints-unstable-v1-client-protocol.h"
#include "wayland-idle-inhibit-unstable-v1-client-protocol.h"

I'd be very grateful if you could test and whip up a pull request.

@andydotxyz
Copy link
Contributor Author

Thanks. The PR #283 fixes the include error - but introduces a lot of compile errors, all similar to the first one, which is:

# github.com/go-gl/glfw/v3.3/glfw
In file included from ../../../../github.com/go-gl/glfw/v3.3/glfw/c_glfw_linbsd.go:9:
../../../../github.com/go-gl/glfw/v3.3/glfw/glfw/src/wl_window.c:29: warning: "_GNU_SOURCE" redefined
   29 | #define _GNU_SOURCE
      | 
<command-line>: note: this is the location of the previous definition
In file included from ../../../../github.com/go-gl/glfw/v3.3/glfw/c_glfw_linbsd.go:10:
../../../../github.com/go-gl/glfw/v3.3/glfw/glfw/src/wl_platform.h:36:16: error: redefinition of ‘struct VkWaylandSurfaceCreateInfoKHR’
   36 | typedef struct VkWaylandSurfaceCreateInfoKHR
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../github.com/go-gl/glfw/v3.3/glfw/glfw/src/internal.h:190,
                 from ../../../../github.com/go-gl/glfw/v3.3/glfw/glfw/src/wl_init.c:29,
                 from ../../../../github.com/go-gl/glfw/v3.3/glfw/c_glfw_linbsd.go:7:
../../../../github.com/go-gl/glfw/v3.3/glfw/glfw/src/wl_platform.h:36:16: note: originally defined here
   36 | typedef struct VkWaylandSurfaceCreateInfoKHR
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@pwaller
Copy link
Member

pwaller commented May 9, 2020

I'm afraid I don't have the cycles to look into this at the moment, I'm only volunteering my time here. Hopefully someone else is around who can take a crack at it. If you don't hear anything back in a while please feel free to ping the thread. If you're able to investigate any further and add more information to the issue you might spur someone into getting this fixed!

@andydotxyz
Copy link
Contributor Author

andydotxyz commented Oct 28, 2020

I finally got round to this and the updated patch works great!

@andydotxyz
Copy link
Contributor Author

andydotxyz commented Nov 1, 2020

Is there anything more I can do to help with this @pwaller - tests or screenshots etc? Seems to compile and run now.

@pwaller
Copy link
Member

pwaller commented Nov 8, 2020

Fixed in #283.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants