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_printf("hello world!\r\n");
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-" T*"6EN="!M86EN*"D-" E[#0H)("` (&1I
M<W!?;W!E;B I.PT*"2` ("!D:7-P7W!R:6YT9B B:&5L;&\ =V]R;&0A7')<
M;B(I.PT*"2` ("!D:7-P7V-L;W-E*"D[#0H)("` (')E='5R;B`P.PT*"7T-
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 Any time the D compiler sees #, it will give the #line integer error, because 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