Hello,
I´m trying to use DFML with dub in a D Project. I have no DSFML related Code in my app.d, I have just added DSFML 2.1.0 to the dependencies in dub.json. If i use "dub build" I get the following Errors:
Performing "debug" build using dmd for x86.
dsfml:system 2.1.0: target for configuration "library" is up to date.
dsfml:audio 2.1.0: building configuration "library"...
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundbuffer.d(63,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundbuffer.d(148,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundbuffer.d(172,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundbuffer.d(196,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundbuffer.d(222,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundbuffer.d(247,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundrecorder.d(61,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundrecorder.d(92,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundstream.d(82,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
C:\Users\me\AppData\Roaming\dub\packages\dsfml-2.1.0\src\dsfml\audio\soundstream.d(278,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
dmd failed with exit code 1.
Those Errors seem to be caused by this code:
class SoundBuffer
{
package sfSoundBuffer* sfPtr;
this()
{
import dsfml.system.string;
sfPtr = sfSoundBuffer_construct();
err.write(toString(sfErr_getOutput())); //This is the excact error position.
}
And similar snippets in other modules.
Which is imho related to this code in the module system.string.d:
immutable(T)[] toString(T)(in const(T)* str) pure
if (is(T == dchar)||is(T == wchar)||is(T == char))
{
return str[0..strlen(str)].idup;
}
I haven´t worked with templates in D yet, but to me it seems allright.
If I skip DSFML.Audio in the dub process, I get similar Errors in Graphics, Window and Network module.
I have tried to comment out the code to skip the "err.write", but some parts in the Network and the Graphics Module are different, so I cant comment them out.
I´m using DUB 0.9.24 (newest) and DMD 2.071.0 (newest).
Thanks in advance.