undefined reference

Tim Newsham newsham@aloha.net
Mon Oct 13 19:00:00 GMT 1997


Hi,

   I found a reference to a function named "NetEnumerateTrustedDomains"
and wanted to use it.  I found it listed in the microsoft headers
in <LMACCESS.H> as:

    NTSTATUS
    NetEnumerateTrustedDomains (
        IN LPWSTR ServerName OPTIONAL,
        OUT LPWSTR *DomainNames
        );

so I made a test case using:

    #include <windows.h>

    DWORD STDCALL NetEnumerateTrustedDomains(LPWSTR, LPWSTR *);
    [... some code ...]

but when I went to link it I got an unresolved error:

    C:\TEMP\cc0010491.o(.text+0x36):doms.c: undefined 
    reference to `NetEnumerateTrustedDomains@8'

so I checked through the libnetapi32.a and found it missing:

    % nm libnetapi32.a |grep NetEnum
    [nothing]

If I look at the netapi32.dll in quikview, its in there:

    Export Table
    Ordinal  Entry Point  Name
    0044     00010786     NetEnumerateTrustedDomains

So the questions

  - why isnt this function in the generated .a?
  - how is it decided which functions are put into the generated .a's?
  - can I call this function without building a new .a?  or can
    I generate a minimal .a that will let me call this function?
  - how can I make a new libnetapi32.a that has this function referenced?

                                          Tim N.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list