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: static variable Default cannot be read at compile time #227

Open
captkirk88 opened this issue May 9, 2016 · 5 comments
Open

Error: static variable Default cannot be read at compile time #227

captkirk88 opened this issue May 9, 2016 · 5 comments

Comments

@captkirk88
Copy link

Entire error is

dsfml-master\dsfml\src\dsfml\window\window.d(95,120): Error: static variable Default cannot be read at compile time

In the constructor for the Window class

this(T)(VideoMode mode, immutable(T)[] title, Style style = Style.DefaultStyle, ref const(ContextSettings) settings = ContextSettings.Default)

ContextSettings.Default is the variable that cannot be read at compile time.

First time I have encountered this error. No other packages have that error.
Thank you.

@Jebbs
Copy link
Owner

Jebbs commented May 9, 2016

This seems strange. Can anyone else verify this?

@neagix
Copy link

neagix commented May 23, 2016

Performing "debug" build using dmd for x86_64.
dsfml:system 2.1.1: building configuration "library"...
dsfml:audio 2.1.1: building configuration "library"...
dsfml:window 2.1.1: building configuration "library"...
dsfml:graphics 2.1.1: building configuration "library"...
dsfml:network 2.1.1: building configuration "library"...
dsfml 2.1.1: building configuration "library"...
kxml 1.0.0: building configuration "library"...
evermore ~master: building configuration "application"...
../../../../../../../.../.dub/packages/dsfml-2.1.1/src/dsfml/audio/soundfile.d(35,35): Error: sfSoundFile_create cannot be interpreted at compile time, because it has no available source code
../../../../../../../.../.dub/packages/dsfml-2.1.1/src/dsfml/audio/music.d(58,16):        called from here: this.m_file.create()
dmd failed with exit code 1.

I am also getting this (totally out of the blue, although it's possible a cached package build was preventing it from popping up before).

@Jebbs
Copy link
Owner

Jebbs commented May 23, 2016

@neagix
Are you creating a Music class at compile time? You can't do that with some things since some things are done on the C++ side.

@neagix
Copy link

neagix commented May 24, 2016

@Jebbs alright, so that's the problem. any idea if in D we can generate a better error when this happens?

@Jebbs
Copy link
Owner

Jebbs commented May 24, 2016

Not sure about error messages, but I was planning on having all/most structs to be initialized lazily. That would fix this problem at least.

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

3 participants