Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
October 08, 2003 Quickquestion | ||||
---|---|---|---|---|
| ||||
If i use implib on a dll created by MSVC, do I need to declare the functions extern (Windows) in my .d file ? C |
October 08, 2003 Re: Quickquestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Sanders | In article <bm1pcg$b79$1@digitaldaemon.com>, Charles Sanders says... > >If i use implib on a dll created by MSVC, do I need to declare the functions extern (Windows) in my .d file ? Of course. The compiler needs to know what you're talking about. You can't have undeclared symbols. Ant |
October 08, 2003 Re: Quickquestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | I mean is it extern (Windows ) or extern (C ) C "Ant" <Ant_member@pathlink.com> wrote in message news:bm1rv2$enc$1@digitaldaemon.com... > In article <bm1pcg$b79$1@digitaldaemon.com>, Charles Sanders says... > > > >If i use implib on a dll created by MSVC, do I need to declare the functions > >extern (Windows) in my .d file ? > > Of course. > The compiler needs to know what you're talking about. > You can't have undeclared symbols. > > Ant > > |
October 08, 2003 Re: Quickquestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Sanders | In article <bm1t0n$g3b$1@digitaldaemon.com>, Charles Sanders says... > >I mean is it extern (Windows ) or extern (C ) > That's a good question. I don't even know why we have (windows) I just found an explanation on the D pages. probably reading it would answer that question. Ant |
October 08, 2003 Re: Quickquestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Sanders | If the C dll uses __cdecl convention, use extern (C), and if it uses __stdcall convention, use extern (Windows). If it uses __fastcall, you're hosed. ;) Sean "Charles Sanders" <sanders-consulting@comcast.net> wrote in message news:bm1t0n$g3b$1@digitaldaemon.com... > I mean is it extern (Windows ) or extern (C ) > > C > "Ant" <Ant_member@pathlink.com> wrote in message > news:bm1rv2$enc$1@digitaldaemon.com... > > In article <bm1pcg$b79$1@digitaldaemon.com>, Charles Sanders says... > > > > > >If i use implib on a dll created by MSVC, do I need to declare the > functions > > >extern (Windows) in my .d file ? > > > > Of course. > > The compiler needs to know what you're talking about. > > You can't have undeclared symbols. > > > > Ant |
October 08, 2003 Re: Quickquestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | "Ant" <Ant_member@pathlink.com> wrote in message news:bm1ur5$ihi$1@digitaldaemon.com... > In article <bm1t0n$g3b$1@digitaldaemon.com>, Charles Sanders says... > > > >I mean is it extern (Windows ) or extern (C ) > > > > That's a good question. I don't even know why > we have (windows) I just found an explanation > on the D pages. probably reading it would > answer that question. > > Ant > A DLL exported function can have any extern.. you just have to use the same one when calling it. By default in your C code, the calling convention is cdecl, which in D is extern(C), or you can specify stdcall in the C code (commonly implemented as __stdcall) and use extern(Windows) in D. It's just most common to use stdcall for DLLs. |
October 08, 2003 Re: Quickquestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | Ahh thanks, sorry think ive asked this before but forgot :). C "Sean L. Palmer" <palmer.sean@verizon.net> wrote in message news:bm1vac$j8s$1@digitaldaemon.com... > If the C dll uses __cdecl convention, use extern (C), and if it uses > __stdcall convention, use extern (Windows). If it uses __fastcall, you're > hosed. ;) > > Sean > > "Charles Sanders" <sanders-consulting@comcast.net> wrote in message news:bm1t0n$g3b$1@digitaldaemon.com... > > I mean is it extern (Windows ) or extern (C ) > > > > C > > "Ant" <Ant_member@pathlink.com> wrote in message > > news:bm1rv2$enc$1@digitaldaemon.com... > > > In article <bm1pcg$b79$1@digitaldaemon.com>, Charles Sanders says... > > > > > > > >If i use implib on a dll created by MSVC, do I need to declare the > > functions > > > >extern (Windows) in my .d file ? > > > > > > Of course. > > > The compiler needs to know what you're talking about. > > > You can't have undeclared symbols. > > > > > > Ant > > |
Copyright © 1999-2021 by the D Language Foundation