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

PIXEL fails compile #169

Closed
godfather667 opened this issue Mar 19, 2019 · 8 comments
Closed

PIXEL fails compile #169

godfather667 opened this issue Mar 19, 2019 · 8 comments

Comments

@godfather667
Copy link

When compiling the following program and others I have problems like this:

github.com/go-gl/glfw/v3.2/glfw

In file included from ./glfw/src/internal.h:169:0,
from ./glfw/src/context.c:28,
from ../github.com/go-gl/glfw/v3.2/glfw/c_glfw.go:4:
./glfw/src/x11_platform.h:39:10: fatal error: X11/Xcursor/Xcursor.h: No such file or directory
#include <X11/Xcursor/Xcursor.h>
^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I get similar errors with GL Library Components.

Can I assume that this is a problem with the version I am using??

Charles Thornton

package main 
import (
	"github.com/faiface/pixel"
	"github.com/faiface/pixel/pixelgl"
	"golang.org/x/image/colornames"
)

func run() {
	cfg := pixelgl.WindowConfig{
		Title:  "Pixel Rocks!",
		Bounds: pixel.R(0, 0, 1024, 768),
		VSync:  true,
	}
	win, err := pixelgl.NewWindow(cfg)
	if err != nil {
		panic(err)
	}

	win.Clear(colornames.Skyblue)

	for !win.Closed() {
		win.Update()
	}
}

func main() {
	pixelgl.Run(run)
}                                                          
@faiface
Copy link
Owner

faiface commented Mar 20, 2019

Have you installed requirements as described here?

@AlexMapley
Copy link

AlexMapley commented May 13, 2019

Are you using dep to manage your dependencies @godfather667?

I ran into a similar problem, where any directories under https://github.com/go-gl/glfw/tree/master/v3.2/glfw/glfw failed to vendor and caused a compilation crash.

Not an issue with faiface/pixel, definitely a dependency issue - Found this specific error coming from https://github.com/go-gl/glfw/blob/master/v3.2/glfw/glfw/src/x11_platform.h#L39. Was able to fix by making sure I had all contents of https://github.com/go-gl/glfw/tree/master/v3.2/glfw/glfw properly loaded.

@nanohard
Copy link

I had a glfw issue as well, I had to manually put it in the right place. It was a while ago, but I remember copying ?/glfw/glfw/ to somewhere.

@domust
Copy link

domust commented Oct 5, 2019

Compilation fails for me too, even though I have all of the required packages installed:

github.com/go-gl/glfw/v3.2/glfw

In file included from ../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/c_glfw_linbsd.go:24:0:
../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/linux_joystick.c: In function ‘_glfwInitJoysticksLinux’:
../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/linux_joystick.c:224:42: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 9 [-Wformat-truncation=]
snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
^~~~~~~
In file included from /usr/include/stdio.h:862:0,
from /usr/include/X11/Xcursor/Xcursor.h:26,
from ../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/x11_platform.h:39,
from ../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/internal.h:169,
from ../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/x11_init.c:28,
from ../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/c_glfw_linbsd.go:19:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 12 and 267 bytes into a destination of size 20
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@bcvery1
Copy link
Contributor

bcvery1 commented Oct 5, 2019

@domust are you sure that's failing to compile? Those are the expected warning messages from GLFW. See: #143

@fgrosse
Copy link
Contributor

fgrosse commented May 9, 2020

Maybe this issue is now resolve since we upgraded to Go modules to track specific versions and also we are now on GLFW 3.3?

@AlexMapley
Copy link

Yeah I would say so too @fgrosse, this issue isn' really relevant anymore with go mod.

@fgrosse
Copy link
Contributor

fgrosse commented May 21, 2020

Cool, @delp I think we can close this then now 😃

@delp delp closed this as completed May 21, 2020
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

8 participants