RejectedSoftware Forums

Sign up

Scanw Error using Ncurses

Every time I try to use the ncurses print in language D of this error

scanw ("% d", & number);

Error: function deimos.ncurses.curses.scanw (char fmt, ...) is not callable using argument types (string, int )

Re: Scanw Error using Ncurses

Am 27.03.2019 um 02:04 schrieb Ncurses Scanw Error:

Every time I try to use the ncurses print in language D of this error

scanw ("% d", & number);

Error: function deimos.ncurses.curses.scanw (char fmt, ...) is not callable using argument types (string, int )

It seems like the signature of scanw in libcurl is missing the const
qualifier, otherwise the code above should work as far as I can see.
Casting to char* should work, though:
scanw(cast(const(char)*)"%d".ptr, &number)

BTW, the D.learn group would be better suited for this kind of question:
https://forum.dlang.org/group/learn

Re: Scanw Error using Ncurses

WARNING: A deprecated branch based version specification is used for the dependency ncurses. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Performing "debug" build using /usr/bin/dmd for x86_64.
ncurses ~master: target for configuration "minimal" is up to date.
hello ~master: building configuration "application"...
source/app.d(9,14): Error: function deimos.ncurses.curses.scanw(char fmt, ...) is not callable using argument types (const(char), int)
source/app.d(9,14): cannot pass argument "0" of type const(char)
to parameter char* fmt
/usr/bin/dmd failed with exit code 1.

Re: Scanw Error using Ncurses

Am 13.06.2019 um 16:24 schrieb gabol:

WARNING: A deprecated branch based version specification is used for the dependency ncurses. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Performing "debug" build using /usr/bin/dmd for x86_64.
ncurses ~master: target for configuration "minimal" is up to date.
hello ~master: building configuration "application"...
source/app.d(9,14): Error: function deimos.ncurses.curses.scanw(char fmt, ...) is not callable using argument types (const(char), int)
source/app.d(9,14): cannot pass argument "0" of type const(char)
to parameter char* fmt
/usr/bin/dmd failed with exit code 1.

Sorry, miswrote the cast: scanw(cast(char*)"%d".ptr, &number)