March 30, 2005calling dll functions
hi, how would one make a call to a dll function, that does not have a leading underscore? i do not have a .lib for the dll. thanx in advance richard
March 31, 2005Re: calling dll functions
Posted in reply to richard koch
"richard koch" <firstname.lastname@example.org> wrote in message news:email@example.com... > how would one make a call to a dll function, that does not have a leading underscore? i do not have a .lib for the dll. I had this problem with a DLL; I solved it with a .def file. Create a .def file (if you don't have one already), and in it, place the following: IMPORTS _name=dllname.name So, if a function in blah.dll is called "Print", but D is looking for something named "_Print", you would write: _Print=blah.Print This sort of creates an alias, so that the linker can translate from the underscored name to the actual name. Then just include the .def file on the commandline when you compile your program.
Copyright © 1999-2016 by the D Language Foundation