I am trying to teach myself AI using neural networks. Long story short, I wanted to create a simple graphic that would display what is happening in my program using ncurses. The tutorial that I am using is found here.
I was under the impression that D was compatible with C and I could theoretically call C functions relatively easily.
I find that not to be the case. I am a relatively novice programmer, so even the simplistic explanations are a little above my head. I found this here.
D is designed to fit comfortably with a C compiler for the target system. D makes up for not having its own VM by relying on the target environment's C runtime library. It would be senseless to attempt to port to D or write D wrappers for the vast array of C APIs available. How much easier it is to just call them directly.
This is done by matching the C compiler's data types, layouts, and function call/return sequences.
That sounds wonderful. A little bit over my head. I tested and got a simple C program working:
#include <curses.h>
int main(void) {
int ch;
initscr();
noecho();
cbreak();
printw("Hit Ctrl+C to exit ...\n\n");
for (;;) {
ch = getch();
printw("Value of char: %d (%02x)\n", ch, ch);
}
endwin();
return 0;
}
shamelessly copied and pasted from another question on SO. At least I did my homework.
I tried basically the same thing from a simple D program. I got this error:
Error: module curses is in file 'curses.d' which cannot be read
I am absolutely positive that I am trying something really stupid.
Is there an easy way to use ncurses in a D program?
I'm running on zero sleep and caffeine, so please be gentle! Even a link to a website would be greatly appreciated!
I probably didn't include everything that I should have, so AMA.
And feel free to insult my intelligence.