D calling C?

Glenn Lewis nospam at nospam.net
Sat Mar 3 20:47:06 PST 2007


Hi!  I'm trying to write a D program that calls C.
I've attached two listings: t1.d and t2.cpp.
Here's what happens:

C:\tmp>dmd -c t1.d
C:\tmp>dmc -c t2.cpp
C:\tmp>dmd -oft1.exe t1.obj t2.obj
C:\dmd\bin\..\..\dm\bin\link.exe t1+t2,t1.exe,,user32+kernel32/noi;
C:\tmp>t1
Error: Access Violation

I'm using DMD version 1.006 and DMC version 8.42n on WinXP.
Anyone have any ideas why this doesn't work?
Thanks!
-- Glenn Lewis
begin 644 t1.d
M:6UP;W)T('-T9"YS=&1I;SL-"@T*97AT97)N("A#*2![(&9L;V%T(&9U;F,H
M9FQO870@=EM=*3L@?0T*#0IV;VED(&UA:6XH8VAA<EM=6UT at 87)G=BD-"GL-
M"B`@9FQO870@=ELR73L-"B`@=ELP72`](#`N,#L-"B`@=ELQ72`](#$N,#L-
M"B`@9FQO870@>"`](&9U;F,H=BD[#0H@('=R:71E9FQN*")X/25G(BP@>"D[
%#0I]#0H`
`
end
begin 644 t2.cpp
M(VEN8VQU9&4@/'-T9&EO+F@^#0H-"F5X=&5R;B`B0R(@>R!F;&]A="!F=6YC
M*&9L;V%T*B!V*3L@?0T*#0IF;&]A="!F=6YC*&9L;V%T('9;72D-"GL-"B`@
M<')I;G1F*")V6S!=/25G+"!V6S%=/25G(BP@=ELP72P@=ELQ72D[#0H@(')E
6='5R;B!V6S!=("L@=ELQ73L-"GT-"@``
`
end



More information about the Digitalmars-d mailing list