www.digitalmars.com         C & C++   DMDScript  

c++ - Entry Points

reply MR <web rnetf.com> writes:
How can I get the linker to search all libraries?

I am trying to use the directory functions, opendir, readdir, closedir, etc.

The header dirent.h contains the declarations but I have had little success in
linking the code.

There seems to be no decent way to locate the library that contains any
specific entry point and I don't seem to be able to get the
linker to search all libraries. The documentation for optlink is, at best,
vague. I set the LIB env. variable to the directory that contains the DM
libraries but
that did not seem to be enough.

Using a strings command, I found the entry points in psxdll.lib. The code
linked but then failed when the dll was not found. There is no psx*.dll in the
system.
May 11 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
MR wrote:
 How can I get the linker to search all libraries?
 
 I am trying to use the directory functions, opendir, readdir, closedir, etc.
 
 The header dirent.h contains the declarations but I have had little success in
 linking the code.
 
 There seems to be no decent way to locate the library that contains any
 specific entry point and I don't seem to be able to get the
 linker to search all libraries. The documentation for optlink is, at best,
 vague. I set the LIB env. variable to the directory that contains the DM
 libraries but
 that did not seem to be enough.
 
 Using a strings command, I found the entry points in psxdll.lib. The code
 linked but then failed when the dll was not found. There is no psx*.dll in the
 system.

The easy way to find the entry points is to just grep for them across the lib files. You can also use the lib command to generate .lst files from the libraries, and then you can see what each library defines. As for opendir, etc., those are part of the posix subsystem. I recommend instead using FindFirstFile/FindNextFile.
May 20 2009