|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
D - error during compiling, using c dll in d code
I just started trying to use D so please ignore my ignorance.
What I want to end up with is a d program that uses a c dll, the C dll have
function for rendering 3D objects.
I converted a c header file to d via htod.
When I compile test.d I get to following error :
D:\d\projects\titanWrapper>dmd test.d
D:\D\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi;
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved
test.obj(test)
Error 42: Symbol Undefined _trCreateGLWindow
--- errorlevel 1
Can anybody give me a tutorial on how to use C dll in D for dummies.
Thanx,
Glen
test.d
import std.c.stdio;
import windowing;
int main()
{
trCreateGLWindow(640,480,16,0);
return 0;
}
windowing.d
/* Converted to D from windowing.h by htod */
module windowing;
alias int BOOL;
//C #define FALSE 0
const TRUE = 1;
//C #endif
const FALSE = 0;
// Exports
//C BOOL trCreateGLWindow(int, int, int, BOOL);
extern (C):
int trCreateGLWindow(int , int , int , int );
Oct 06 2006
|