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

Go-SDL/ttf incompatible with Go 1.0.1? #57

Open
sbward opened this issue May 18, 2012 · 3 comments
Open

Go-SDL/ttf incompatible with Go 1.0.1? #57

sbward opened this issue May 18, 2012 · 3 comments

Comments

@sbward
Copy link

sbward commented May 18, 2012

Go-SDL/ttf does not build successfully on Go 1.0.1.

$ go get -u github.com/banthar/Go-SDL/ttf
# github.com/banthar/Go-SDL/ttf
1: error: 'TTF_GetFontHinting' undeclared (first use in this function)
1: note: each undeclared identifier is reported only once for each function it appears in
1: error: 'TTF_SetFontHinting' undeclared (first use in this function)
1: error: 'TTF_GetFontOutline' undeclared (first use in this function)
1: error: 'TTF_SetFontOutline' undeclared (first use in this function)

Making Go-SDL/ttf:

~/go/src/github.com/banthar/Go-SDL/ttf$ make
Makefile:5: /usr/lib/go/src/Make.inc: No such file or directory
Makefile:22: /usr/lib/go/src/Make.pkg: No such file or directory
make: *** No rule to make target `/usr/lib/go/src/Make.pkg'.  Stop.
@jackpal
Copy link

jackpal commented Sep 5, 2012

I think the problem is that those functions are missing from SDL_ttf.h, which is part of the C SDL library.

Maybe it's a version issue. Maybe we're using a SDL 2.0 and this code is expecting some newer version of SDL.

I worked around the issue by commenting out each of the lines in ttf.go that referred to an undeclared identifier.

@bussiere
Copy link

bussiere commented Mar 5, 2013

same here 👍 go get -u github.com/banthar/Go-SDL/ttf

github.com/banthar/Go-SDL/ttf

1: error: 'TTF_SetFontHinting' undeclared (first use in this function)
1: note: each undeclared identifier is reported only once for each function it appears in
1: error: 'TTF_SetFontOutline' undeclared (first use in this function)
1: error: 'TTF_GetFontOutline' undeclared (first use in this function)
1: error: 'TTF_GetFontHinting' undeclared (first use in this function)

@djmdjm
Copy link

djmdjm commented Jul 10, 2013

Commenting out the *FontOutline and *FontHinting methods gets it going for me on Ubuntu Precise with libsdl-ttf-2.09:

diff --git a/ttf/ttf.go b/ttf/ttf.go
index 3401543..d1a4a74 100644
--- a/ttf/ttf.go
+++ b/ttf/ttf.go
@@ -161,13 +161,13 @@ func (f *Font) GetStyle() int { return int(C.TTF_GetFontSt
 // Sets the rendering style of the font.
 func (f *Font) SetStyle(style int) { C.TTF_SetFontStyle(f.cfont, C.int(style)) 

-func (f *Font) GetOutline() int { return int(C.TTF_GetFontOutline(f.cfont)) }
+// func (f *Font) GetOutline() int { return int(C.TTF_GetFontOutline(f.cfont)) 

-func (f *Font) SetOutline(outline int) { C.TTF_SetFontOutline(f.cfont, C.int(ou
+// func (f *Font) SetOutline(outline int) { C.TTF_SetFontOutline(f.cfont, C.int

-func (f *Font) GetHinting() int { return int(C.TTF_GetFontHinting(f.cfont)) }
+// func (f *Font) GetHinting() int { return int(C.TTF_GetFontHinting(f.cfont)) 

-func (f *Font) SetHinting(hinting int) { C.TTF_SetFontHinting(f.cfont, C.int(hi
+// func (f *Font) SetHinting(hinting int) { C.TTF_SetFontHinting(f.cfont, C.int

 // Returns the maximum height of all the glyphs of the font.
 func (f *Font) Height() int { return int(C.TTF_FontHeight(f.cfont)) }

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

4 participants