September 18, 2005 Re: Undefined Windows function | ||||
---|---|---|---|---|
| ||||
Posted in reply to John C | In article <dgi423$12v5$1@digitaldaemon.com>, John C says... > >"J C Calvarese" <technocrat7@gmail.com> wrote in message news:dgi1da$10mn$1@digitaldaemon.com... >> In article <dggt4s$19u$1@digitaldaemon.com>, John C says... >>> >>>"Regan Heath" <regan@netwin.co.nz> wrote in message news:opsw8pdwk423k2f5@nrage.netwin.co.nz... >>>> On Sat, 17 Sep 2005 09:05:40 +0000 (UTC), Kramer >>>> <Kramer_member@pathlink.com> wrote: >>>>> I'm trying to use a Windows function that I don't think is defined with >>>>> the DMD >>>>> distribution. The code below seems to compile just fine, but I'm >>>>> getting linker >>>>> errors. I know that means the linker can't find the function in the >>>>> object >>>>> files, but I'm not sure how to proceed. I've given my best effort to >>>>> provide >>>>> the windows data structure and function definitions and am also linking >>>>> to >>>>> user32.lib which is what Microsoft says is the library that contains >>>>> the >>>>> function I'm looking for, but still to no avail. Any ideas would be >>>>> greatly >>>>> appreciated. >> .. >>>>> Error 42: Symbol Undefined _GetWindowInfo@8 >>>>> --- errorlevel 1 .. >>> IMPORTS >>> >>>2) Now list all the functions the linker says are undefined, eg >>> >>> _GetWindowInfo@8 = GetWindowInfo >>> >>>3) Go to http://www.digitalmars.com/download/freecompiler.html and >>>download >>>the free "Basic Utilities" package, and unzip to c:\dm\bin or wherever >>>your >>>dm\bin directory is located. Then at the command line, cd to the directory >>>you created the user32ex.def file (usually c:\dm\lib) and enter this: >>> >>> c:\dm\bin\implib user32ex.lib user32ex.def >>> >>>4) Add user32ex.lib to your dmd command line when compiling >>> >>>John. >> >> I think you explained the problem and solution very well, so I added your >> explanation to the wiki at the "error messages" page at: >> http://www.prowiki.org/wiki4d/wiki.cgi?ErrorMessages#Youneglectedtoprovidethelinkerwithaneededbinaryfile >> >> jcc7 > >Cool. Of course, I made a slight error. "IMPORTS" should be "EXPORTS". Ah, that's right. I fixed it at the wiki. Thanks again. jcc7 |
Copyright © 1999-2021 by the D Language Foundation