Undefined function, even though imported

Loopback elliott.darfink at gmail.com
Tue Jun 14 10:15:19 PDT 2011


On 2011-06-14 18:30, Trass3r wrote:
> Am 14.06.2011, 02:43 Uhr, schrieb Loopback <elliott.darfink at gmail.com>:
>
>> Thanks for all the answers! Seems like rdmd did the trick.
>> I don't see why this isn't built in to dmd though
>
> No one does ;)
>
Haha well it would be nice if at least one soul knew and could explain..
>> I've also stumbled upon an additional error with the win32 DirectX
>> bindings, but this seems D related actually. When I compile any code
>> at all (with rdmd) which imports win32.directx.d3d9 and uses the
>> function Direct3DCreate9, the linker issues this warning:
>>
>> Error 42: Symbol Undefined _Direct3DCreate9 at 4
>
> So the other functions in d3d9 work but only this one doesn't?
>
>
Yeah, that's why I think this i related to D somehow and not the
binding itself. Though I'm just guessing.
>> Both of these links says that the problem is solved by adding
>> _Direct3DCreate9 to imports. I've tried to do this by linking to a
>> .def file with this content (without success, same error is still
>> issued).
>>
>> EXETYPE NT
>> SUBSYSTEM WINDOWS
>>
>> IMPORTS
>> _Direct3DCreate9 at 4=d3d9.Direct3DCreate9
>
> ^^ This can't work cause the linker knows nothing about D modules.
> You'd have to use the correct D mangled name.
I see your point, but I think the IMPORTS statement refers to the lib
file, and the lib file is still C (since D can import c libs).

But I still haven't got it to work yet, so I would really appreciate
if someone knows what I am doing wrong with the def file/pragma
statements!


More information about the Digitalmars-d-learn mailing list