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

Build failed on FreeBSD #16

Closed
Martinfx opened this issue May 25, 2019 · 7 comments
Closed

Build failed on FreeBSD #16

Martinfx opened this issue May 25, 2019 · 7 comments

Comments

@Martinfx
Copy link

Hello i would like compile engine but i have problem with dependencies

go mod init
go build

go: extracting golang.org/x/image v0.0.0-20171214225156-12117c17ca67
go: downloading github.com/hashicorp/yamux v0.0.0-20171219165022-683f49123a33
go: extracting github.com/hashicorp/yamux v0.0.0-20171219165022-683f49123a33
# github.com/go-gl/glfw/v3.2/glfw
In file included from ../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20170814180746-513e4f2bf85c/v3.2/glfw/c_glfw.go:4:
In file included from ./glfw/src/context.c:28:
In file included from ./glfw/src/internal.h:169:
./glfw/src/x11_platform.h:36:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.
# github.com/go-gl/gl/v3.3-core/gl
../../go/pkg/mod/github.com/go-gl/gl@v0.0.0-20170915061432-ac0d3d2af0fe/v3.3-core/gl/procaddr.go:52:11: fatal error: 'GL/glx.h' file not found
        #include <GL/glx.h>
                 ^~~~~~~~~~

@icexin
Copy link
Owner

icexin commented May 27, 2019

I have not tested on FreeBSD. The error message shows that X Window Header is missing. You may try installing the X development library on the machine.

@Martinfx
Copy link
Author

Yes i know. I have this headers in my machine.

/usr/local/include/X11/Xlib.h
/usr/local/include/GL/glx.h

@icexin
Copy link
Owner

icexin commented May 29, 2019

Maybe /usr/local/include is not in the default include path, try CGO_CFLAGS="-I/usr/local/include" go build

@Martinfx
Copy link
Author

Martinfx commented Jun 2, 2019

Thank you for fot the path but failed linker with go build

# github.com/go-gl/gl/v3.3-core/gl
/usr/bin/ld: cannot find -lGL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
# github.com/go-gl/gl/v3.3-core/gl
../../go/pkg/mod/github.com/go-gl/gl@v0.0.0-20170915061432-ac0d3d2af0fe/v3.3-core/gl/procaddr.go:54:28: warning: passing 'const char *' to parameter of type 'const GLubyte *' (aka 'const unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
/usr/local/include/GL/glx.h:325:48: note: passing argument to parameter 'procname' here
# github.com/go-gl/glfw/v3.2/glfw
/usr/bin/ld: cannot find -lGL
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@icexin
Copy link
Owner

icexin commented Jun 3, 2019

trying CGO_CFLAGS="-I/usr/local/include" CGO_LDFLAGS="-L/usr/local/lib" go build

@Martinfx
Copy link
Author

Thank you go build

go build
# github.com/go-gl/glfw/v3.2/glfw
In file included from ../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20170814180746-513e4f2bf85c/v3.2/glfw/c_glfw.go:4:
In file included from ./glfw/src/context.c:28:
In file included from ./glfw/src/internal.h:169:
./glfw/src/x11_platform.h:36:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.
^[[B# github.com/go-gl/gl/v3.3-core/gl
../../go/pkg/mod/github.com/go-gl/gl@v0.0.0-20170915061432-ac0d3d2af0fe/v3.3-core/gl/procaddr.go:52:11: fatal error: 'GL/glx.h' file not found
        #include <GL/glx.h>
          

@Martinfx
Copy link
Author

Martinfx commented Jun 24, 2019

OK i found problem, this is right command only some warnings. Last problem i have with fish. Thank you M.

$ CGO_CFLAGS="-I/usr/local/include" CGO_LDFLAGS="-L/usr/local/lib" go build
# github.com/go-gl/gl/v3.3-core/gl
../../go/pkg/mod/github.com/go-gl/gl@v0.0.0-20170915061432-ac0d3d2af0fe/v3.3-core/gl/procaddr.go:54:28: warning: passing 'const char *' to parameter of type 'const GLubyte *' (aka 'const unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
/usr/local/include/GL/glx.h:325:48: note: passing argument to parameter 'procname' here

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