|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D 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 electronics |
digitalmars.D.announce - Re: QtD 0.1 is out!
Bill Baxter Wrote:On Fri, Feb 13, 2009 at 5:00 AM, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Bill Baxter Wrote:On Fri, Feb 13, 2009 at 4:22 AM, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Can somebody help me with exporting functions from a DLL? I am defining functions in C++ like extern "C" __declspec(dllexport) void* __qtd_QObject_QObject_QObject(args) After compiling a DLL with MINGW and producing a lib file for it with implib I am trying to use them from D. In D I declare them as extern (C) void* __qtd_QObject_QObject_QObject(args); And then compile it and link it to the .lib file made by implib for that DLL, but optlink complains that symbol is undefined. I tried to use that Cfunction from C++ and it worked. What I can do? Feb 12 2009
On Thu, 12 Feb 2009 15:48:07 -0500, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Bill Baxter Wrote:On Fri, Feb 13, 2009 at 5:00 AM, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Bill Baxter Wrote:On Fri, Feb 13, 2009 at 4:22 AM, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Can somebody help me with exporting functions from a DLL? I am defining functions in C++ like extern "C" __declspec(dllexport) void* __qtd_QObject_QObject_QObject(args) After compiling a DLL with MINGW and producing a lib file for it with implib I am trying to use them from D. In D I declare them as extern (C) void* __qtd_QObject_QObject_QObject(args); And then compile it and link it to the .lib file made by implib for that DLL, but optlink complains that symbol is undefined. I tried to use that Cfunction from C++ and it worked. What I can do? Feb 12 2009
Max Samukha Wrote:On Thu, 12 Feb 2009 15:48:07 -0500, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Bill Baxter Wrote:On Fri, Feb 13, 2009 at 5:00 AM, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Bill Baxter Wrote:On Fri, Feb 13, 2009 at 4:22 AM, Eldar Insafutdinov <e.insafutdinov gmail.com> wrote:Can somebody help me with exporting functions from a DLL? I am defining functions in C++ like extern "C" __declspec(dllexport) void* __qtd_QObject_QObject_QObject(args) After compiling a DLL with MINGW and producing a lib file for it with implib I am trying to use them from D. In D I declare them as extern (C) void* __qtd_QObject_QObject_QObject(args); And then compile it and link it to the .lib file made by implib for that DLL, but optlink complains that symbol is undefined. I tried to use that Cfunction from C++ and it worked. What I can do? Feb 12 2009
Eldar Insafutdinov Wrote:This way won't really work because there are dozens of such a functions - that's for virtual dispatch. I have just solved it by declaring functions "export extern (C)" and adding "_" prefix to function name when calling GetProcAddress. So technically there are no issues to make qtd working on windows! Feb 14 2009
|