D - [win32]How use a dll?
- uwem (27/27) Dec 01 2003 Hello!
- Ant (8/10) Dec 02 2003 Don't they say the only stupid question is the one not asked?
- uwem (42/47) Dec 02 2003 Thanks!
- Lars Ivar Igesund (6/56) Dec 02 2003 Have you tried to add
- uwem (3/7) Dec 02 2003 Thanks! The error message from the linker is the same. :-|
- Lars Ivar Igesund (10/20) Dec 03 2003 Ah, I think I see your problem now. Put the export
Hello! I'm new to 'D' .. sorry for this stupid question. 1. I create a dll with a class (proceeding: D for Win32) class test { export { this() { } ~this() { } void doIt() { printf("Im the dll\n"); } } } 2. compile: dmd test.d test.def 3. I have: test.dll, test.map, test.obj In c++ i have a '*.lib' file for the dll. How can i use this dll in a other D - exe (program)? Thanks in advance. Bye Uwe My english is not the best. :-)
Dec 01 2003
In article <bqhc0g$jph$1 digitaldaemon.com>, uwem says...Hello! I'm new to 'D' .. sorry for this stupid question.Don't they say the only stupid question is the one not asked? I'm not sure about this but it might be the same problem I had (I'm not a windows guy). You have to use the implib utility from http://www.digitalmars.com/download/freecompiler.html as I remember that will create a .lib. Ant
Dec 02 2003
In article <bqig9q$2bob$1 digitaldaemon.com>, Ant says...I'm not sure about this but it might be the same problem I had (I'm not a windows guy). You have to use the implib utility from http://www.digitalmars.com/download/freecompiler.html as I remember that will create a .lib.Thanks! My proceeding: in the file 'test.d': class test { export { this() { } ~this() { } void doIt() { printf("test.doIt()\n"); } } } and the other stuff for win-dll creation compile: dmd test.d test.def implib : implib /s test.lib test.dll In the file 'testdll.d': import test; void myfunc() { test xx = new test; xx.doIt(); } compile: dmd testdll.d test.lib linker says: OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved dlltest.obj(dlltest) Error 42: Symbol undefined __Class_4test3test --- errorlevel 1 :-( Any ideas? Thanks in advance. Bye Uwe
Dec 02 2003
Have you tried to add module test; to the top of your test.d file? Lars Ivar Igesund "uwem" <uwem_member pathlink.com> wrote in message news:bqk1gu$1ieu$1 digitaldaemon.com...In article <bqig9q$2bob$1 digitaldaemon.com>, Ant says...I'm not sure about this but it might be the same problem I had (I'm not a windows guy). You have to use the implib utility from http://www.digitalmars.com/download/freecompiler.html as I remember that will create a .lib.Thanks! My proceeding: in the file 'test.d': class test { export { this() { } ~this() { } void doIt() { printf("test.doIt()\n"); } } } and the other stuff for win-dll creation compile: dmd test.d test.def implib : implib /s test.lib test.dll In the file 'testdll.d': import test; void myfunc() { test xx = new test; xx.doIt(); } compile: dmd testdll.d test.lib linker says: OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved dlltest.obj(dlltest) Error 42: Symbol undefined __Class_4test3test --- errorlevel 1 :-( Any ideas? Thanks in advance. Bye Uwe
Dec 02 2003
In article <bqk2d9$1joc$1 digitaldaemon.com>, Lars Ivar Igesund says...Have you tried to add module test; to the top of your test.d file? Lars Ivar IgesundThanks! The error message from the linker is the same. :-| Uwe
Dec 02 2003
Ah, I think I see your problem now. Put the export in front of the class declaration: export class test { etc. This will export both your class and the public methods of your class. Note that when you use the export keyword, you don't need to use a .def file. Lars Ivar Igesund "uwem" <uwem_member pathlink.com> wrote in message news:bqk4i6$1mpr$1 digitaldaemon.com...In article <bqk2d9$1joc$1 digitaldaemon.com>, Lars Ivar Igesund says...Have you tried to add module test; to the top of your test.d file? Lars Ivar IgesundThanks! The error message from the linker is the same. :-| Uwe
Dec 03 2003