www.digitalmars.com         C & C++   DMDScript  

D - disp.h error - coba.d

reply tantius <tantius_member pathlink.com> writes:
i try to run the example program
#include <disp.h>

int main()
{
disp_open();
disp_printf("hello world!\r\n");
disp_close();
return 0;
}

it has error like this

C:\My Documents\D\coba.d(1): #line integer ["filespec"]\n expected
C:\My Documents\D\coba.d(1): Declaration expected, not '<'




begin 0644 coba.d
M(VEN8VQU9&4 /&1I<W`N:#X-
M<W!?;W!E;B I.PT*"2` ("!D:7-P7W!R:6YT9B B:&5L;&\ =V]R;&0A7')<

!"B(I
`
end
Sep 19 2003
next sibling parent Brad Anderson <brad sankaty.com> writes:
tantius wrote:
 i try to run the example program
 #include <disp.h>
 
 C:\My Documents\D\coba.d(1): #line integer ["filespec"]\n expected
 
You must write disp.d yourself to wrap the C header file into D. Then at the top of your coba.d file, use import instead of #include <disp.h>: import disp; There are two useful guides to doing this disp.h to disp.d conversion: Walter's: http://www.digitalmars.com/d/htomodule.html Mike Wynn's: http://www.l8night.co.uk/mwynn/d/deimos.html in D, there is no preprocessor. Hope this helps. BA
Sep 19 2003
prev sibling parent "Carlos Santander B." <carlos8294 msn.com> writes:
Andy Friesen wrote a small console library. I modified it so it supports
functions in disp.h. In http://earth.prohosting.com/carlos3/console.html you
can find that modified console library, including disp.d.

—————————————————————————
Carlos Santander


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 2003-09-11
Sep 19 2003