Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
October 06, 2013 Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
I have noticed that a number of the current Windows C functions are not in core.sys.windows.windows.d I tried adding them to the module (after setting up source control so I can roll back any errors I might make), and found that Optlink wasn't finding the functions to resolve the symbols to. How do I go about getting the libraries that have the missing functionality, and once I have it, is it simply a case of editing the above module to make them available? |
October 06, 2013 Re: Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matt | On Sunday, 6 October 2013 at 19:44:16 UTC, Matt wrote: > I have noticed that a number of the current Windows C functions are not in core.sys.windows.windows.d > > I tried adding them to the module (after setting up source control so I can roll back any errors I might make), and found that Optlink wasn't finding the functions to resolve the symbols to. How do I go about getting the libraries that have the missing functionality, and once I have it, is it simply a case of editing the above module to make them available? Please see the following project for an updated binding to Windows functions: http://www.dsource.org/projects/bindings/wiki/WindowsApi Typically you link to one of the distributed Windows DLLs via an import library, e.g. you would pass "kernel32.lib" at the command-line when calling DMD for any functions in the kernel32 DLL. kernel32.lib is the import lib, and it's distributed along with DMD. |
October 07, 2013 Re: Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | > Typically you link to one of the distributed Windows DLLs via an import library, e.g. you would pass "kernel32.lib" at the command-line when calling DMD for any functions in the kernel32 DLL. kernel32.lib is the import lib, and it's distributed along with DMD.
I have never had to specify any Windows libs for linking under DMD. What is different about these?
|
October 07, 2013 Re: Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matt | On 10/7/13, Matt <webwraith@fastmail.fm> wrote:
> I have never had to specify any Windows libs for linking under DMD. What is different about these?
DMD links in user32.lib and kernel32.lib by default. But if you want to use other libs like GDI you're going to have to pass them at the command line.
|
October 07, 2013 Re: Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On Monday, 7 October 2013 at 14:45:35 UTC, Andrej Mitrovic wrote:
> On 10/7/13, Matt <webwraith@fastmail.fm> wrote:
>> I have never had to specify any Windows libs for linking under
>> DMD. What is different about these?
>
> DMD links in user32.lib and kernel32.lib by default. But if you want
> to use other libs like GDI you're going to have to pass them at the
> command line.
The missing functions (or at least the one I'm interested in at the moment) that I'm trying to use are supposed to be IN kernel32, and have been in there since Windows Vista. That's why I'm a little confused.
|
October 07, 2013 Re: Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matt | On 10/7/13, Matt <webwraith@fastmail.fm> wrote: > The missing functions (or at least the one I'm interested in at the moment) that I'm trying to use are supposed to be IN kernel32, and have been in there since Windows Vista. That's why I'm a little confused. The kernel32.lib distributed with DMD is likely out of date. See: http://d.puremagic.com/issues/show_bug.cgi?id=6625 |
October 08, 2013 Re: Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On 10/8/2013 6:57 AM, Andrej Mitrovic wrote:
> On 10/7/13, Matt <webwraith@fastmail.fm> wrote:
>> The missing functions (or at least the one I'm interested in at
>> the moment) that I'm trying to use are supposed to be IN
>> kernel32, and have been in there since Windows Vista. That's why
>> I'm a little confused.
>
> The kernel32.lib distributed with DMD is likely out of date.
> See: http://d.puremagic.com/issues/show_bug.cgi?id=6625
>
It's very out of date. When I need Windows functions that are missing from the DMD libs, I prototype them as function pointers and load them dynamically. It's a one-off investment for each function and I don't need many of them, so no big deal.
|
October 08, 2013 Re: Getting the missing Windows functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Tuesday, 8 October 2013 at 08:54:44 UTC, Mike Parker wrote: > On 10/8/2013 6:57 AM, Andrej Mitrovic wrote: >> On 10/7/13, Matt <webwraith@fastmail.fm> wrote: >>> The missing functions (or at least the one I'm interested in at >>> the moment) that I'm trying to use are supposed to be IN >>> kernel32, and have been in there since Windows Vista. That's why >>> I'm a little confused. >> >> The kernel32.lib distributed with DMD is likely out of date. >> See: http://d.puremagic.com/issues/show_bug.cgi?id=6625 >> > > It's very out of date. When I need Windows functions that are missing from the DMD libs, I prototype them as function pointers and load them dynamically. It's a one-off investment for each function and I don't need many of them, so no big deal. I always run this when I install a new dmd cd C:\D\dmd2\windows\lib\ coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\advapi32.lib" advapi32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\comctl32.lib" comctl32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\comdlg32.lib" comdlg32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\gdi32.lib" gdi32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\kernel32.lib" kernel32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\shell32.lib" shell32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\shlwapi.lib" shlwapi.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\user32.lib" user32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\ws2_32.lib" ws2_32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\wsock32.lib" wsock32.lib |
Copyright © 1999-2021 by the D Language Foundation