View previous topic :: View next topic |
Author |
Message |
jdrewsen
Joined: 05 Mar 2008 Posts: 21 Location: Copenhagen, Denmark
|
Posted: Tue Dec 28, 2010 9:49 am Post subject: Build error |
|
|
Just tried to build yage but got at build error
I don't think the error message from DMD is that clear - maybe some of you can deciffer it for me?
Code: |
yage/build$ dmd -run ./buildyage.d
buildyage is not a supported argument.
Building Yage...
If you're curious, the options are:
-ddoc Generate documentation in the doc folder
-debug Include debugging symbols and enable stack tracing on Windows.
Otherwise optimize, inline functions, and remove unittests/asserts.
-lib Create a yage lib file in the lib folder.
-profile Compile in profiling code.
-run Run when finished.
-silent Don't print this message.
-verbose Print all commands as they're being executed.
Example: dmd -run buildyage.d -release -run
...
yage/core/memory.d(23): Error: class yage.core.memory.Memory unable to resolve forward reference in definition
yage/core/math/vector.d(401): Error: template instance yage.core.math.vector.Vec!(4,int) error instantiating
yage/core/math/vector.d(413): instantiated from here: toVec!(4,int)
yage/core/math/vector.d(401): instantiated from here: Vec!(3,int)
yage/core/math/vector.d(412): instantiated from here: toVec!(3,int)
... (5 instantiations, -v to show) ...
yage/core/math/vector.d(408): instantiated from here: toVec!(2,float)
yage/core/math/vector.d(596): instantiated from here: Vec!(4,float)
object.Exception: Compiler failed.
|
It doesn't specify what forward reference it means!! |
|
Back to top |
|
|
jdrewsen
Joined: 05 Mar 2008 Posts: 21 Location: Copenhagen, Denmark
|
Posted: Tue Dec 28, 2010 3:58 pm Post subject: |
|
|
okey... I got a little closer to the problem. It seems to be the Singleton mixin in the memory.d file. I tried to grep the entire code base and found out that this is the only place Singleton is actually used.
When looking at misc.d where Singleton is defined the unittest that tests the Singleton has been commented out!
Anyway now I know the problem... just have to find a proper solution. Is anyone able to build it on windows with dmd 1.064? It doesn't on linux as you can see. |
|
Back to top |
|
|
jdrewsen
Joined: 05 Mar 2008 Posts: 21 Location: Copenhagen, Denmark
|
Posted: Tue Dec 28, 2010 4:42 pm Post subject: |
|
|
well replaced the following line in memory.d:
Code: | private mixin Singleton!(Memory);
|
with the expanded mixin in linux and it all works now. I still don't know if this is a dmd 1.064 problem or linux problem though.
Code: | version (linux) {
private static uint tls_key=uint.max;
/**
* Get an instance unique to the calling thread.
* Each thread can only have one instance. */
static Memory getInstance()
{
if (tls_key==uint.max)
synchronized(Memory.classinfo)
tls_key = Thread.createLocal();
Memory result = cast(Memory)Thread.getLocal(tls_key);
if (!result)
{ result = new Memory();
Thread.setLocal(tls_key, cast(void*)result);
}
return result;
}
}
version (Windows) {
private mixin Singleton!(Memory);
}
|
|
|
Back to top |
|
|
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Tue Dec 28, 2010 6:43 pm Post subject: |
|
|
I'm still using dmd 1.056 that's bundled with tango 0.9.99.[/list] |
|
Back to top |
|
|
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Tue Dec 28, 2010 11:44 pm Post subject: |
|
|
Go ahead and commit this change, if you don't mind. Better for it to work for everyone instead of require 1.056. |
|
Back to top |
|
|
jdrewsen
Joined: 05 Mar 2008 Posts: 21 Location: Copenhagen, Denmark
|
Posted: Wed Dec 29, 2010 8:01 am Post subject: |
|
|
done |
|
Back to top |
|
|
That Guy
Joined: 01 Jan 2011 Posts: 5 Location: Edwards, CO
|
Posted: Sat Jan 01, 2011 6:37 am Post subject: |
|
|
jdrewsen wrote: | Anyway now I know the problem... just have to find a proper solution. Is anyone able to build it on windows with dmd 1.064? It doesn't on linux as you can see. |
Hi. I just started playing around on Yage. With a completely unmodified version of trunk, I am getting this error. And I am on a Windows box as my linux desktop is having hardware issues.
I have tried with:tango-0.99.9-bin-win32-dmd.1.056.zip
dmd.1.030.zip + tango-0.99.9-bin-win32.zip
dmd.1.066.zip + tango-0.99.9-bin-win32.zip The fix was to inline the Singleton. Sure, I could be doing something wrong as I don't have too much D experience, but I had the exact same issue with the same fix. |
|
Back to top |
|
|
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Sat Jan 01, 2011 11:55 am Post subject: |
|
|
That's quite strange. I'm on Windows XP Pro 32-bit, dmd 1.056+tango 0.99.9 and it compiles fine for me before and after jdrewson's change. Oh well. At least now it should work for everyone. |
|
Back to top |
|
|
|