June 14, 2011 Re: Undefined function, even though imported | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | Trass3r Wrote:
> > Shouldn't the linker/compiler be able to solve this on its own then?
>
> Use rdmd or xfBuild to automatically compile all needed modules.
Everyone we'll keep asking that question forever until the D compiler does this by itself :-)
Bye,
bearophile
|
June 14, 2011 Re: Undefined function, even though imported | ||||
---|---|---|---|---|
| ||||
Posted in reply to Loopback | Am 14.06.2011, 02:43 Uhr, schrieb Loopback <elliott.darfink@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 ;) > 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@4 So the other functions in d3d9 work but only this one doesn't? > 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@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. |
June 14, 2011 Re: Undefined function, even though imported | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | On 2011-06-14 18:30, Trass3r wrote: > Am 14.06.2011, 02:43 Uhr, schrieb Loopback <elliott.darfink@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@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@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! |
June 14, 2011 Re: Undefined function, even though imported | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | Well, I solved the linker error by specifying imports in the .def file. The pathetic thing was that the def file was invalid just because I had a newline, or at least it worked without it. So my final .def file looks like this: EXETYPE NT SUBSYSTEM WINDOWS IMPORTS _Direct3DCreate9@4 = d3d9.Direct3DCreate9 Thanks for all help! |
Copyright © 1999-2021 by the D Language Foundation