www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What I thought was straightforward blew up in my face..

reply WhatMeWorry <kheaser gmail.com> writes:
import bindbc.sdl;
import bindbc.loader;


SDL_version ver;
SDL_GetVersion(&ver);
		
writeln("version = ", ver);	  // runs and displays: version = 
SDL_version(2, 30, 2)
	
writeln("version = ", SDL_GetVersion(&ver));  // compile fails 
with
		
// template `writeln` is not callable using argument types 
`!()(string, void)`
// C:\D\dmd2\windows\bin64\..\..\src\phobos\std\stdio.d(4249,6): 
Candidate is: `writeln(T...)(T args)`
// Error C:\D\dmd2\windows\bin64\dmd.exe failed with exit code 1.	

I'll confess I can't make heads or tails out of the error 
messages.  Is this impossible or is there some way to make 
writeln happy?
Apr 10
parent "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
```c
void SDL_GetVersion(SDL_version * ver);
```

It doesn't return anything.

Its return type is void.

See the argument list where it lists the types of the arguments:

``template writeln is not callable using argument types !()(string, void)``

Which aligns with the arguments you passed to ``writeln``.
Apr 10