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

ERROR: Function <glutStrokeCharacter> called without first calling 'glutInit' #1

Open
ludflu opened this issue Jan 1, 2015 · 4 comments

Comments

@ludflu
Copy link

ludflu commented Jan 1, 2015

after successfully building everything in the sandbox, running the executable fails like this:

jsnavely@beefy ~/project/game-in-haskell (master)$ cabal run shapes-demo
Preprocessing executable 'shapes-demo' for game-in-haskell-book-0.1.0.0...
freeglut ERROR: Function called without first calling 'glutInit'.

I'm running GHC 7.8.3 on Ubuntu 14.04.1 LTS

I can, however, run the frp-demo without encountering the error until after the program exits.

@dino-
Copy link
Contributor

dino- commented Feb 20, 2015

I'm seeing this as well, same as above. GHC 7.8.4 on Arch Linux.

@jmillikan
Copy link

Same issue, Ubuntu 14.04 LTS; I hacked around it by explicitly initializing GLUT and made a pull request for it, but the hacked is probably not compatible with all systems.

@yuvallanger
Copy link

@jmillikan Could you link to your patch and explain a bit how to use it?

@jmillikan
Copy link

@yuvallanger It's this pull request pointing to this commit. It's built and run the same as the original, but here's the short version assuming not a lot of prior knowledge.

I'm actually on a new box, so I'm filling in the details here while doing it. I have GHC 7.8.4 and Cabal 1.22.0.0 (library the same) installed from binaries, but Haskell Platform 2014.2.0.0 also works.

First, you'll need some externals - on Ubuntu, try sudo apt-get install freeglut3 freeglut3-dev libalut0 libalut-dev. Until you have them all, the cabal build will fail with semi-helpful messages.

Clone my repository and switch to the hacky branch: git clone https://github.com/jmillikan/game-in-haskell.git && git checkout ubuntu-glut-backend.

In the root of that (with the .cabal file), make a sandbox and build the demos in it: cabal sandbox init && cabal install and watch das blinkenlights.

Once finished, you should find all the working demos in .cabal-sandbox/bin, e.g. ./.cabal-sandbox/bin/frp-demo should end correctly with the Game Over message! (It still has to be killed manually.)

And, to re-iterate, this is just a hack that makes very little sense, but lets you work the examples in Linux.

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