www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Phobos and Tango deep dependancies

reply Gilles G. <schaouette free.fr> writes:
Hello all,
I noticed that using the phobos library on windows make the executables depend
on a huge list of delay loaded DLLs and also 5 "always loaded" DLLs (the list
is below).
I also tried the Tango library and the situation seems to be even worse...

I would like to know why this dependancies exists and if there is something I
can do to reduce them (maybe recompile phobos with some options?).

Background: I wrote a DLL using D for a third-party software and they want me
to reduce the dependancies...

Any help would be *greatly* appreciated.
Thanks again.

--
Gilles G.



Here is the DLL dependancy list for a simple "hello, word!" using writefln (I
use the program depends.exe to track the dependancies):
 * Always loaded DLLs:
MPR.DLL, GDI32.DLL, KERNEL32.DLL, NTDLL.DLL, USER32.DLL

 * Delay loaded DLLs:
ACTIVEDS.DLL, ADSLDPC.DLL, ADVAPI32.DLL, ADVPACK.DLL, APPHELP.DLL, ATL.DLL,
AUTHZ.DLL, BROWSEUI.DLL, CABINET.DLL, DFVIEW.DLL, CERTCLI.DLL, CFGMGR32.DLL,
CLUSAPI.DLL, COMCTL32.DLL, COMDLG32.DLL, CREDUI.DLL, CRYPT32.DLL, CRYPTUI.DLL,
CSCDLL.DLL, DBGHELP.DLL, DEVMGR.DLL, DHCPCSVC.DLL, DNSAPI.DLL, DUSER.DLL,
EFSADU.DLL, ESENT.DLL, GDIPLUS.DLL, HLINK.DLL, HNETCFG.DLL, IMAGEHLP.DLL,
IMGUTIL.DLL, IMM32.DLL
INETCOMM.DLL, IPHLPAPI.DLL, LINKINFO.DLL, LZ32.DLL, MFC42U.DLL, MLANG.DLL,
MOBSYNC.DLL, MPRAPI.DLL, MPRUI.DLL, MSASN1.DLL, MSGINA.DLL, MSHTML.DLL,
MSI.DLL, MSIMG32.DLL, MSJAVA.DLL, MSLS31.DLL, MSOERT2.DLL, MSRATING.DLL,
MSSIGN32.DLL, MSVCP60.DLL, MSVCRT.DLL, MSWSOCK.DLL, NETAPI32.DLL, NETCFGX.DLL,
NETMAN.DLL, NETPLWIZ.DLL, NETRAP.DLL, NETSHELL.DLL, NETUI0.DLL, NETUI1.DLL,
NETUI2.DLL, NTDSAPI.DLL
NTLANMAN.DLL, ODBC32.DLL, OLE32.DLL, OLEACC.DLL, OLEAUT32.DLL
OLEDLG.DLL, OLEPRO32.DLL, POWRPROF.DLL, PRINTUI.DLL, PSAPI.DLL
QUERY.DLL, RASAPI32.DLL, RASDLG.DLL, RASMAN.DLL, REGAPI.DLL
RPCRT4.DLL, RTUTILS.DLL, SAMLIB.DLL, SCECLI.DLL, SECUR32.DLL, SETUPAPI.DLL,
SHDOCVW.DLL, SHELL32.DLL, SHLWAPI.DLL, SHSVCS.DLL
TAPI32.DLL, URLMON.DLL, USERENV.DLL, USP10.DLL, UTILDLL.DLL, UXTHEME.DLL,
VERSION.DLL, W32TOPL.DLL,,WINHTTP.DLL, WININET.DLL, WINMM.DLL, WINSCARD.DLL,
WINSPOOL.DRV, INSTA.DLL, WINTRUST.DLL, WLDAP32.DLL, WMI.DLL, WS2_32.DLL,
WS2HELP.DLL, WSOCK32.DLL, WTSAPI32.DLL, WZCDLG.DLL, WZCSAPI.DLL, WZCSVC.DLL
Oct 02 2007
next sibling parent reply Lars Ivar Igesund <larsivar igesund.net> writes:
Gilles G. wrote:

 Hello all,
 I noticed that using the phobos library on windows make the executables
 depend on a huge list of delay loaded DLLs and also 5 "always loaded" DLLs
 (the list is below). I also tried the Tango library and the situation
 seems to be even worse...
I am no Windows guru, but aren't all those system DLL's? You will be hard pushed to avoid those when using the console. As for Tango, could you please post a list and the relevant program? Feel free to use the Tango forums, or create a ticket if it seems to be bug in Tango. Using the same compiler, Tango shouldn't have more dependencies than Phobos for the same functionality. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Oct 02 2007
parent reply Gilles G. <schaouette free.fr> writes:
I tried to compile a simple hello, world with visual studio 2005 express and
there are only 4 DLL dependancies...

The program for tango is:

import tango.io.Stdout;

int main()
{
    Stdout("Hello, world!").newline;
    return 0;
}

And the dependancies are listed below:
 * 10 Always loaded DLLs:
MPR.DLL, ADVAPI32.DLL, GDI32.DLL, KERNEL32.DLL, MSVCRT.DLL, NTDLL.DLL,
RPCRT4.DLL, SHELL32.DLL, SHLWAPI.DLL, USER32.DLL

 * 108 Delay loaded DLLs:
ACTIVEDS.DLL, ADSLDPC.DLL, ADVPACK.DLL, APPHELP.DLL, ATL.DLL, AUTHZ.DLL,
BROWSEUI.DLL, CABINET.DLL, CDFVIEW.DLL, CERTCLI.DLL, CFGMGR32.DLL, CLUSAPI.DLL,
COMCTL32.DLL, COMDLG32.DLL, CREDUI.DLL, CRYPT32.DLL, CRYPTUI.DLL, CSCDLL.DLL,
DBGHELP.DLL, DEVMGR.DLL, DHCPCSVC.DLL, DNSAPI.DLL, DUSER.DLL, EFSADU.DLL,
ESENT.DLL, GDIPLUS.DLL, HLINK.DLL,HNETCFG.DLL ,IMAGEHLP.DLL, IMGUTIL.DLL,
IMM32.DLL, INETCOMM.DLL, IPHLPAPI.DLL,
 LINKINFO.DLL,LZ32.DLL ,MFC42U.DLL ,MLANG.DLL , MOBSYNC.DLL, MPRAPI.DLL,
MPRUI.DLL, MSASN1.DLL, MSGINA.DLL, MSHTML.DLL, MSI.DLL, MSIMG32.DLL,
MSJAVA.DLL, MSLS31.DLL, MSOERT2.DLL, MSRATING.DLL, MSSIGN32.DLL, MSVCP60.DLL,
MSWSOCK.DLL, NETAPI32.DLL, NETCFGX.DLL, NETMAN.DLL, NETPLWIZ.DLL,
 NETRAP.DLL, NETSHELL.DLL, NETUI0.DLL, NETUI1.DLL, NETUI2.DLL, NTDSAPI.DLL,
NTLANMAN.DLL, ODBC32.DLL, OLE32.DLL, OLEACC.DLL, OLEAUT32.DLL,  OLEDLG.DLL,
OLEPRO32.DLL, POWRPROF.DLL, PRINTUI.DLL, PSAPI.DLL, QUERY.DLL, RASAPI32.DLL,
RASDLG.DLL, RASMAN.DLL, REGAPI.DLL, RTUTILS.DLL,  SAMLIB.DLL, SCECLI.DLL,
SECUR32.DLL, SETUPAPI.DLL, SHDOCVW.DLL, SHSVCS.DLL, TAPI32.DLL, URLMON.DLL,
USERENV.DLL, USP10.DLL, UTILDLL.DLL, UXTHEME.DLL, VERSION.DLL, W32TOPL.DLL,
WINHTTP.DLL, WININET.DLL, WINMM.DLL, WINSCARD.DLL, WINSPOOL.DRV, WINSTA.DLL,
WINTRUST.DLL, LDAP32.DLL, WMI.DLL, WS2_32.DLL, WS2HELP.DLL, WSOCK32.DLL,
WTSAPI32.DLL, WZCDLG.DLL, WZCSAPI.DLL, WZCSVC.DLL


This may be compared to phobos : 5 always loaded DLLs and 112 delay loaded DLLs.

--
Gilles

Lars Ivar Igesund Wrote:

 Gilles G. wrote:
 
 Hello all,
 I noticed that using the phobos library on windows make the executables
 depend on a huge list of delay loaded DLLs and also 5 "always loaded" DLLs
 (the list is below). I also tried the Tango library and the situation
 seems to be even worse...
I am no Windows guru, but aren't all those system DLL's? You will be hard pushed to avoid those when using the console. As for Tango, could you please post a list and the relevant program? Feel free to use the Tango forums, or create a ticket if it seems to be bug in Tango. Using the same compiler, Tango shouldn't have more dependencies than Phobos for the same functionality. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Oct 02 2007
next sibling parent reply DavidL <Davidl 126.com> writes:
在 Tue, 02 Oct 2007 17:50:20 +0800,Gilles G. <schaouette free.fr> 写道:

 I tried to compile a simple hello, world with visual studio 2005 express  
 and there are only 4 DLL dependancies...

 The program for tango is:

 import tango.io.Stdout;

 int main()
 {
     Stdout("Hello, world!").newline;
     return 0;
 }

 And the dependancies are listed below:
  * 10 Always loaded DLLs:
 MPR.DLL, ADVAPI32.DLL, GDI32.DLL, KERNEL32.DLL, MSVCRT.DLL, NTDLL.DLL,  
 RPCRT4.DLL, SHELL32.DLL, SHLWAPI.DLL, USER32.DLL

  * 108 Delay loaded DLLs:
 ACTIVEDS.DLL, ADSLDPC.DLL, ADVPACK.DLL, APPHELP.DLL, ATL.DLL, AUTHZ.DLL,  
 BROWSEUI.DLL, CABINET.DLL, CDFVIEW.DLL, CERTCLI.DLL, CFGMGR32.DLL,  
 CLUSAPI.DLL, COMCTL32.DLL, COMDLG32.DLL, CREDUI.DLL, CRYPT32.DLL,  
 CRYPTUI.DLL, CSCDLL.DLL, DBGHELP.DLL, DEVMGR.DLL, DHCPCSVC.DLL,  
 DNSAPI.DLL, DUSER.DLL, EFSADU.DLL, ESENT.DLL, GDIPLUS.DLL,  
 HLINK.DLL,HNETCFG.DLL ,IMAGEHLP.DLL, IMGUTIL.DLL, IMM32.DLL,  
 INETCOMM.DLL, IPHLPAPI.DLL,
  LINKINFO.DLL,LZ32.DLL ,MFC42U.DLL ,MLANG.DLL , MOBSYNC.DLL, MPRAPI.DLL,  
 MPRUI.DLL, MSASN1.DLL, MSGINA.DLL, MSHTML.DLL, MSI.DLL, MSIMG32.DLL,  
 MSJAVA.DLL, MSLS31.DLL, MSOERT2.DLL, MSRATING.DLL, MSSIGN32.DLL,  
 MSVCP60.DLL, MSWSOCK.DLL, NETAPI32.DLL, NETCFGX.DLL, NETMAN.DLL,  
 NETPLWIZ.DLL,
  NETRAP.DLL, NETSHELL.DLL, NETUI0.DLL, NETUI1.DLL, NETUI2.DLL,  
 NTDSAPI.DLL, NTLANMAN.DLL, ODBC32.DLL, OLE32.DLL, OLEACC.DLL,  
 OLEAUT32.DLL,  OLEDLG.DLL, OLEPRO32.DLL, POWRPROF.DLL, PRINTUI.DLL,  
 PSAPI.DLL, QUERY.DLL, RASAPI32.DLL, RASDLG.DLL, RASMAN.DLL, REGAPI.DLL,  
 RTUTILS.DLL,  SAMLIB.DLL, SCECLI.DLL, SECUR32.DLL, SETUPAPI.DLL,  
 SHDOCVW.DLL, SHSVCS.DLL, TAPI32.DLL, URLMON.DLL, USERENV.DLL, USP10.DLL,  
 UTILDLL.DLL, UXTHEME.DLL, VERSION.DLL, W32TOPL.DLL, WINHTTP.DLL,  
 WININET.DLL, WINMM.DLL, WINSCARD.DLL, WINSPOOL.DRV, WINSTA.DLL,  
 WINTRUST.DLL, LDAP32.DLL, WMI.DLL, WS2_32.DLL, WS2HELP.DLL, WSOCK32.DLL,  
 WTSAPI32.DLL, WZCDLG.DLL, WZCSAPI.DLL, WZCSVC.DLL


 This may be compared to phobos : 5 always loaded DLLs and 112 delay  
 loaded DLLs.

 --
 Gilles

 Lars Ivar Igesund Wrote:

 Gilles G. wrote:

 Hello all,
 I noticed that using the phobos library on windows make the  
executables
 depend on a huge list of delay loaded DLLs and also 5 "always loaded"  
DLLs
 (the list is below). I also tried the Tango library and the situation
 seems to be even worse...
I am no Windows guru, but aren't all those system DLL's? You will be hard pushed to avoid those when using the console. As for Tango, could you please post a list and the relevant program? Feel free to use the Tango forums, or create a ticket if it seems to be bug in Tango. Using the same compiler, Tango shouldn't have more dependencies than Phobos for the same functionality. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
If those DLLs exist, then no problem at all. You gain nothing negative. To kill those dependencies of DLLs would be troublesome AFAIC. -- 使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
Oct 02 2007
parent reply Gilles G. <schaouette free.fr> writes:
DavidL Wrote:
 If those DLLs exist, then no problem at all. You gain nothing negative.
 To kill those dependencies of DLLs would be troublesome AFAIC.
This is exactly the problem. Some DLLs may not exist on some systems. This is the case for the man who develops the application which I wrote a DLL for: some delay-load DLLs are missing on his system. As these are delay-load DLLs it doesn't crash (yet), but this worries him very much. Any idea anybody? -- Gilles
Oct 02 2007
next sibling parent reply Jason House <jason.james.house gmail.com> writes:
Gilles G. Wrote:

 DavidL Wrote:
 If those DLLs exist, then no problem at all. You gain nothing negative.
 To kill those dependencies of DLLs would be troublesome AFAIC.
This is exactly the problem. Some DLLs may not exist on some systems. This is the case for the man who develops the application which I wrote a DLL for: some delay-load DLLs are missing on his system. As these are delay-load DLLs it doesn't crash (yet), but this worries him very much. Any idea anybody?
Are you linking against stuff such as libphobos? Is it possible to only compile in the exact .d files you need to use? I think dsss tries to do that by default?
Oct 02 2007
parent reply Gilles G. <schaouette free.fr> writes:
Jason House Wrote:
 Are you linking against stuff such as libphobos?  Is it possible to only
compile in the exact .d files you need to use?  I think dsss tries to do that
by default?
Here is an example (file main.d): import std.stdio; int main() { writefln("Hello, world!"); return 0; } I compile with DMD like this:
 dmd -oftest main.d
This will create the executable "test.exe" linked against libphobos because I use a fonction from the standard lib. Running "depends.exe" on the executable "test.exe" shows more than a hundred DLL dependancies. I tried DSSS with this dsss.conf: [main.d] target=test But the result is the same...
Oct 02 2007
parent reply Jason House <jason.james.house gmail.com> writes:
On my linux system (that I don't have access to at themoment), dsss creates a
folder called dsss_objs that has all the individual dependency files compiled
as .o (AKA .obj) files.  I'd look there to see what it thinks the file depends
on and then try to figure out why they were needed.

It could be that operation on windows is different or that my method is
fundamentally flawed.  If I had your problem, it is where I'd start.

If it's not a problem with lots of stuff getting included, then I'd say it's
the overall library bringing in bloat.  Under linux, I know there's way to not
link against a complete library and instead just the individual files that dsss
creates.

Gilles G. Wrote:

 Jason House Wrote:
 Are you linking against stuff such as libphobos?  Is it possible to only
compile in the exact .d files you need to use?  I think dsss tries to do that
by default?
Here is an example (file main.d): import std.stdio; int main() { writefln("Hello, world!"); return 0; } I compile with DMD like this:
 dmd -oftest main.d
This will create the executable "test.exe" linked against libphobos because I use a fonction from the standard lib. Running "depends.exe" on the executable "test.exe" shows more than a hundred DLL dependancies. I tried DSSS with this dsss.conf: [main.d] target=test But the result is the same...
Oct 02 2007
parent Walter Bright <newshound1 digitalmars.com> writes:
Jason House wrote:
 If it's not a problem with lots of stuff getting included, then I'd
 say it's the overall library bringing in bloat.  Under linux, I know
 there's way to not link against a complete library and instead just
 the individual files that dsss creates.
Here's an easy way to see if a dll, say kernel32.dll, is being required by something in phobos.lib: grep -i kernel32 phobos.lib If there are no hits, then phobos CANNOT be pulling it in.
Oct 02 2007
prev sibling parent reply torhu <no spam.invalid> writes:
Gilles G. wrote:
 DavidL Wrote:
 If those DLLs exist, then no problem at all. You gain nothing negative.
 To kill those dependencies of DLLs would be troublesome AFAIC.
This is exactly the problem. Some DLLs may not exist on some systems. This is the case for the man who develops the application which I wrote a DLL for: some delay-load DLLs are missing on his system. As these are delay-load DLLs it doesn't crash (yet), but this worries him very much. Any idea anybody? -- Gilles
Are you sure this is a real problem? C (msvc) hello world apps delay-load user32.dll, while DMD links with it. That might be the only difference here. I believe that win95 and later comes with this file.
Oct 02 2007
parent Jascha Wetzel <firstname mainia.de> writes:
torhu wrote:
 Gilles G. wrote:
 DavidL Wrote:
 If those DLLs exist, then no problem at all. You gain nothing negative.
 To kill those dependencies of DLLs would be troublesome AFAIC.
This is exactly the problem. Some DLLs may not exist on some systems. This is the case for the man who develops the application which I wrote a DLL for: some delay-load DLLs are missing on his system. As these are delay-load DLLs it doesn't crash (yet), but this worries him very much. Any idea anybody? -- Gilles
Are you sure this is a real problem? C (msvc) hello world apps delay-load user32.dll, while DMD links with it. That might be the only difference here. I believe that win95 and later comes with this file.
together with kernel32, user32 is *the* system library in any 32bit windows system, starting with the win32s extension for windows 3.1. it is absolutely no problem for applications. it might become a problem for device drivers, though.
Oct 03 2007
prev sibling parent reply Jascha Wetzel <firstname mainia.de> writes:
Gilles G. wrote:
 And the dependancies are listed below:
  * 10 Always loaded DLLs:
 MPR.DLL, ADVAPI32.DLL, GDI32.DLL, KERNEL32.DLL, MSVCRT.DLL, NTDLL.DLL,
RPCRT4.DLL, SHELL32.DLL, SHLWAPI.DLL, USER32.DLL
 
  * 108 Delay loaded DLLs:
 ACTIVEDS.DLL, ADSLDPC.DLL, ADVPACK.DLL, APPHELP.DLL, ATL.DLL, AUTHZ.DLL,
BROWSEUI.DLL, CABINET.DLL, CDFVIEW.DLL, CERTCLI.DLL, CFGMGR32.DLL, CLUSAPI.DLL,
COMCTL32.DLL, COMDLG32.DLL, CREDUI.DLL, CRYPT32.DLL, CRYPTUI.DLL, CSCDLL.DLL,
DBGHELP.DLL, DEVMGR.DLL, DHCPCSVC.DLL, DNSAPI.DLL, DUSER.DLL, EFSADU.DLL,
ESENT.DLL, GDIPLUS.DLL, HLINK.DLL,HNETCFG.DLL ,IMAGEHLP.DLL, IMGUTIL.DLL,
IMM32.DLL, INETCOMM.DLL, IPHLPAPI.DLL,
  LINKINFO.DLL,LZ32.DLL ,MFC42U.DLL ,MLANG.DLL , MOBSYNC.DLL, MPRAPI.DLL,
MPRUI.DLL, MSASN1.DLL, MSGINA.DLL, MSHTML.DLL, MSI.DLL, MSIMG32.DLL,
MSJAVA.DLL, MSLS31.DLL, MSOERT2.DLL, MSRATING.DLL, MSSIGN32.DLL, MSVCP60.DLL,
MSWSOCK.DLL, NETAPI32.DLL, NETCFGX.DLL, NETMAN.DLL, NETPLWIZ.DLL,
  NETRAP.DLL, NETSHELL.DLL, NETUI0.DLL, NETUI1.DLL, NETUI2.DLL, NTDSAPI.DLL,
NTLANMAN.DLL, ODBC32.DLL, OLE32.DLL, OLEACC.DLL, OLEAUT32.DLL,  OLEDLG.DLL,
OLEPRO32.DLL, POWRPROF.DLL, PRINTUI.DLL, PSAPI.DLL, QUERY.DLL, RASAPI32.DLL,
RASDLG.DLL, RASMAN.DLL, REGAPI.DLL, RTUTILS.DLL,  SAMLIB.DLL, SCECLI.DLL,
SECUR32.DLL, SETUPAPI.DLL, SHDOCVW.DLL, SHSVCS.DLL, TAPI32.DLL, URLMON.DLL,
USERENV.DLL, USP10.DLL, UTILDLL.DLL, UXTHEME.DLL, VERSION.DLL, W32TOPL.DLL,
WINHTTP.DLL, WININET.DLL, WINMM.DLL, WINSCARD.DLL, WINSPOOL.DRV, WINSTA.DLL,
WINTRUST.DLL, LDAP32.DLL, WMI.DLL, WS2_32.DLL, WS2HELP.DLL, WSOCK32.DLL,
WTSAPI32.DLL, WZCDLG.DLL, WZCSAPI.DLL, WZCSVC.DLL
 
 
 This may be compared to phobos : 5 always loaded DLLs and 112 delay loaded
DLLs.
Actually, Phobos and Tango executables only depend on KERNEL32.DLL and USER32.DLL. The rest of the DLLs you listed are dependencies of KERNEL32.DLL and USER32.DLL. KERNEL32.DLL uses NTDLL.DLL, USER32.DLL uses GDI32, ADVAPI etc. Especially USER32.DLL spans a whole tree of mostly delay loaded dependencies. The exact dependencies of USER32.DLL vary between windows versions. KERNEL32.DLL contains memory management, IO, threading, etc. USER32.DLL contains the GUI, window manager and such. You cannot go without KERNEL32, USER32 might be obsolete, though. My CLI apps appear to only pull in MessageBoxA, although none of the D code (neither mine nor Phobos/Tango) uses it. This is mostly a cosmetic problem, though, since USER32 is a fundamental system DLL that will always be loaded before your program starts. Those additional DLLs that you listed for the Tango version, are static dependencies of USER32.DLL, they have to be loaded in the Phobos version, too.
Oct 02 2007
parent Sean Kelly <sean f4.ca> writes:
Jascha Wetzel wrote:
 Gilles G. wrote:
 And the dependancies are listed below:
  * 10 Always loaded DLLs:
 MPR.DLL, ADVAPI32.DLL, GDI32.DLL, KERNEL32.DLL, MSVCRT.DLL, NTDLL.DLL, 
 RPCRT4.DLL, SHELL32.DLL, SHLWAPI.DLL, USER32.DLL

  * 108 Delay loaded DLLs:
 ACTIVEDS.DLL, ADSLDPC.DLL, ADVPACK.DLL, APPHELP.DLL, ATL.DLL, 
 AUTHZ.DLL, BROWSEUI.DLL, CABINET.DLL, CDFVIEW.DLL, CERTCLI.DLL, 
 CFGMGR32.DLL, CLUSAPI.DLL, COMCTL32.DLL, COMDLG32.DLL, CREDUI.DLL, 
 CRYPT32.DLL, CRYPTUI.DLL, CSCDLL.DLL, DBGHELP.DLL, DEVMGR.DLL, 
 DHCPCSVC.DLL, DNSAPI.DLL, DUSER.DLL, EFSADU.DLL, ESENT.DLL, 
 GDIPLUS.DLL, HLINK.DLL,HNETCFG.DLL ,IMAGEHLP.DLL, IMGUTIL.DLL, 
 IMM32.DLL, INETCOMM.DLL, IPHLPAPI.DLL,
  LINKINFO.DLL,LZ32.DLL ,MFC42U.DLL ,MLANG.DLL , MOBSYNC.DLL, 
 MPRAPI.DLL, MPRUI.DLL, MSASN1.DLL, MSGINA.DLL, MSHTML.DLL, MSI.DLL, 
 MSIMG32.DLL, MSJAVA.DLL, MSLS31.DLL, MSOERT2.DLL, MSRATING.DLL, 
 MSSIGN32.DLL, MSVCP60.DLL, MSWSOCK.DLL, NETAPI32.DLL, NETCFGX.DLL, 
 NETMAN.DLL, NETPLWIZ.DLL,
  NETRAP.DLL, NETSHELL.DLL, NETUI0.DLL, NETUI1.DLL, NETUI2.DLL, 
 NTDSAPI.DLL, NTLANMAN.DLL, ODBC32.DLL, OLE32.DLL, OLEACC.DLL, 
 OLEAUT32.DLL,  OLEDLG.DLL, OLEPRO32.DLL, POWRPROF.DLL, PRINTUI.DLL, 
 PSAPI.DLL, QUERY.DLL, RASAPI32.DLL, RASDLG.DLL, RASMAN.DLL, 
 REGAPI.DLL, RTUTILS.DLL,  SAMLIB.DLL, SCECLI.DLL, SECUR32.DLL, 
 SETUPAPI.DLL, SHDOCVW.DLL, SHSVCS.DLL, TAPI32.DLL, URLMON.DLL, 
 USERENV.DLL, USP10.DLL, UTILDLL.DLL, UXTHEME.DLL, VERSION.DLL, 
 W32TOPL.DLL, WINHTTP.DLL, WININET.DLL, WINMM.DLL, WINSCARD.DLL, 
 WINSPOOL.DRV, WINSTA.DLL, WINTRUST.DLL, LDAP32.DLL, WMI.DLL, 
 WS2_32.DLL, WS2HELP.DLL, WSOCK32.DLL, WTSAPI32.DLL, WZCDLG.DLL, 
 WZCSAPI.DLL, WZCSVC.DLL


 This may be compared to phobos : 5 always loaded DLLs and 112 delay 
 loaded DLLs.
Actually, Phobos and Tango executables only depend on KERNEL32.DLL and USER32.DLL. The rest of the DLLs you listed are dependencies of KERNEL32.DLL and USER32.DLL. KERNEL32.DLL uses NTDLL.DLL, USER32.DLL uses GDI32, ADVAPI etc. Especially USER32.DLL spans a whole tree of mostly delay loaded dependencies. The exact dependencies of USER32.DLL vary between windows versions.
Tango also links shell32.lib on Win32, which is responsible for the few additional dependencies there. Sean
Oct 02 2007
prev sibling next sibling parent Sean Kelly <sean f4.ca> writes:
Gilles G. wrote:
 Hello all,
 I noticed that using the phobos library on windows make the executables depend
on a huge list of delay loaded DLLs and also 5 "always loaded" DLLs (the list
is below).
 I also tried the Tango library and the situation seems to be even worse...
Tango has an additional dependency which is used to turn the code page command-line arguments into UTF-8. If Windows ever moves to a full Unicode console, this dependency can be dropped.
 I would like to know why this dependancies exists and if there is something I
can do to reduce them (maybe recompile phobos with some options?).
They are kernel DLLs for the most part. Walter would probably be best suited to answer this though, since the dependencies are more likely a side-effect of linking the DMC C runtime (snn.lib, I believe), which is an implicit part of every D program on Win32/DMD. The exception handling mechanism, for example, uses Windows Structured Exception Handling by necessity, and this has Win32 kernel dependencies. Sean
Oct 02 2007
prev sibling next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Gilles G. wrote:
 Hello all, I noticed that using the phobos library on windows make
 the executables depend on a huge list of delay loaded DLLs and also 5
 "always loaded" DLLs (the list is below). I also tried the Tango
 library and the situation seems to be even worse...
 
 I would like to know why this dependancies exists and if there is
 something I can do to reduce them (maybe recompile phobos with some
 options?).
 
 Background: I wrote a DLL using D for a third-party software and they
 want me to reduce the dependancies...
 
 Any help would be *greatly* appreciated. Thanks again.
 
 -- Gilles G.
 
 
 
 Here is the DLL dependancy list for a simple "hello, word!" using
 writefln (I use the program depends.exe to track the dependancies): *
 Always loaded DLLs: MPR.DLL, GDI32.DLL, KERNEL32.DLL, NTDLL.DLL,
 USER32.DLL
phobos.lib doesn't have any dependencies on various dll's, except that std.socket pulls in ws2_32. All the dll dependencies come from the C runtime library, snn.lib. The only explicitly loaded dll's in snn.lib are kernel32 and user32. Any other dll's are loaded by those dll's, and any dynamically loaded dll's are loaded by those dll's. Not by phobos or snn.
Oct 02 2007
prev sibling next sibling parent reply Gilles G. <schaouette free.fr> writes:
Walter Bright Wrote:
 phobos.lib doesn't have any dependencies on various dll's, except that 
 std.socket pulls in ws2_32. All the dll dependencies come from the C 
 runtime library, snn.lib.
 
 The only explicitly loaded dll's in snn.lib are kernel32 and user32. Any 
 other dll's are loaded by those dll's, and any dynamically loaded dll's 
 are loaded by those dll's. Not by phobos or snn.
OK. It is much clearer now: it is the C runtime which loads load kernel32 and user32. And as Jascha Wetzel said user32 is the one which brings most of these dependancies. But why does the C runtime library for DMD requires user32? A simple hello world program compiled using visual 2005 express does not depend on user32! Is there any way to solve this?
Oct 02 2007
next sibling parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Gilles G." <schaouette free.fr> wrote in message 
news:fdu60s$2pf6$1 digitalmars.com...
 But why does the C runtime library for DMD requires user32? A simple hello 
 world program compiled using visual 2005 express does not depend on 
 user32!
 Is there any way to solve this?
Let me get this straight: you're complaining about a dependency on a DLL which every system has. Aren't there more important things you should be worrying about?
Oct 02 2007
prev sibling parent reply "Vladimir Panteleev" <thecybershadow gmail.com> writes:
On Tue, 02 Oct 2007 22:26:20 +0300, Gilles G. <schaouette free.fr> wrote:

 But why does the C runtime library for DMD requires user32? A simple hello
world program compiled using visual 2005 express does not depend on user32!
 Is there any way to solve this?
user32.dll is pulled in because of one import - MessageBoxA. In case that an unhandled exception or other internal error happens, and the application doesn't have a console (or, more precisely, a standard output stream), a message box is shown. This could be remedied by delay-importing it. -- Best regards, Vladimir mailto:thecybershadow gmail.com
Oct 02 2007
parent Gilles G. <schaouette free.fr> writes:
Vladimir Panteleev Wrote:
 user32.dll is pulled in because of one import - MessageBoxA. In case that an
unhandled exception or other internal error happens, and the application
doesn't have a console (or, more precisely, a standard output stream), a
message box is shown. This could be remedied by delay-importing it.
*this* is a precious piece of information. It will unfortunately not allow me to solve the problem, but it is a good explanation for the software developer for which I am writing a DLL. Thank you very much Vladimir. -- Gilles
Oct 03 2007
prev sibling next sibling parent "Vladimir Panteleev" <thecybershadow gmail.com> writes:
On Tue, 02 Oct 2007 12:01:08 +0300, Gilles G. <schaouette free.fr> wrote:

 I would like to know why this dependancies exists and if there is something I
can do to reduce them (maybe recompile phobos with some options?).
Most of the dependencies you listed are loaded by various Windows components, and are directly or indirectly "pulled in" by user32.dll. I recommend using Microsoft Dependency Walker [1], as it shows a nice tree view of which DLL importing which. [1] http://www.dependencywalker.com/ -- Best regards, Vladimir mailto:thecybershadow gmail.com
Oct 02 2007
prev sibling parent "Chris Miller" <chris dprogramming.com> writes:
On Tue, 02 Oct 2007 05:01:08 -0400, Gilles G. <schaouette free.fr> wrote:

 Hello all,
 I noticed that using the phobos library on windows make the executables  
 depend on a huge list of delay loaded DLLs and also 5 "always loaded"
Some of those DLLs don't sound right, like why would a D program depend on MFC? It might be some the Windows DLLs use optionally if present, not a dependency of the D program.
Oct 02 2007