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

What am I doing wrong? #522

Open
Keyn1 opened this issue May 30, 2022 · 1 comment
Open

What am I doing wrong? #522

Keyn1 opened this issue May 30, 2022 · 1 comment

Comments

@Keyn1
Copy link

Keyn1 commented May 30, 2022

If I compile a program with "github.com/veandco/go-sdl2/sdl "then everything is ok. The program is compiled.
If I insert "github.com/veandco/go-sdl2/ttf " then I get an error

C:\GoPrg\sdl2_start>go build main.go # github.com/veandco/go-sdl2/ttf In file included from C:\Users\Keyn\go\pkg\mod\github.com\veandco\[email protected]\ttf\sdl_ttf.go:6: ./sdl_ttf_wrapper.h:2:18: fatal error: SDL2/SDL_ttf.h: No such file or directory 2 | #include <SDL2/SDL_ttf.h> | ^~~~~~~~~~~~~~~~ compilation terminated.

the file exists C:\Users\Keyn\go\pkg\mod\github.com\veandco\[email protected]\include\SDL2\SDL_ttf.h

How to solve the problem?

@veeableful
Copy link
Contributor

Hi @Keyn1, I think that is because SDL2_ttf is not installed in the Windows environment. You can download the runtime library here and the header file from the source code here. They can be put in the same location as the SDL2 that you have installed.

Alternatively, you could try running the static compilation build that has been tested to work in Linux. It would use our included, pre-compiled SDL2 libraries using go build -tags static -ldflags="-s -w" on Windows. I tested running it using Git Bash and it seems to work.

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