digitalmars.D.learn - calling dll functions
richard koch <richard_member pathlink.com> writes:
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
Mar 30 2005
"Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"richard koch" <richard_member pathlink.com> wrote in message news:d2eimb$1euv$1 digitaldaemon.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.
Mar 31 2005