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

Paths_nehe_tuts.hs gives broken absolute path #2

Open
dagit opened this issue Nov 1, 2011 · 3 comments
Open

Paths_nehe_tuts.hs gives broken absolute path #2

dagit opened this issue Nov 1, 2011 · 3 comments

Comments

@dagit
Copy link
Owner

dagit commented Nov 1, 2011

We use the path to the data dir from the cabal provided modules but when the path is not defined or defined incorrect we get segfaults. Really this points to two separate issues:

  • Don't trust the path from that module, and check it so we don't segfault
  • Use a different mechanism that provides relative paths or is otherwise less brittle to how people build the examples vs. how they run them.
@jellehermsen
Copy link

After trying to compile lesson6 and up GHC complained about a the module Paths_nehe_tuts being missing. After adding the file Paths_nehe_tuts.hs with the following contents it worked fine (given that you have all the image assets under data/ relative to the hs-files):

module Paths_nehe_tuts where

getDataFileName :: FilePath -> IO FilePath
getDataFileName fileName = return $ "data/" ++ fileName

@dagit
Copy link
Owner Author

dagit commented May 14, 2014

I have to admit, I haven't built the examples in a while or with the new sandbox features in cabal.

Cabal used to generate that module automatically. Are you saying it no longer gets created or that you made it yourself to avoid having cabal do it?

@jellehermsen
Copy link

I didn't get past the "runhaskell Setup configure" part, because it complained about missing depencies (GLFW-b >= 1.0.0). I'm not sure why, because I have 1.4.6 installed. So I did compile it manually, which works fine after generating the Paths-file.

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