August 20, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to maarten van damme | maarten van damme Wrote:
> But where does the lib file searches for the dll file? how can we control that? Is my hunch right?
The dll is searched by the system. It's a documented procedure. You can control it to some degree by manifest files.
|
August 20, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin Attachments:
| That explains it, thank you.
Now only how come that
"dmd hello.d" results in a 1.70 mb application whereas
"dmd -c hello.d" && "dmd hello.obj phobos.lib" results in a 144 kb app
(sorry for confusion, Turns out I didn't link my app with phobos.lib but
recompiled the object file with phobos.lib
2011/8/20 Kagamin <spam@here.lot>
> maarten van damme Wrote:
>
> > But where does the lib file searches for the dll file? how can we control that? Is my hunch right?
>
> The dll is searched by the system. It's a documented procedure. You can control it to some degree by manifest files.
>
|
August 20, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to maarten van damme | On 20.08.2011 14:07, maarten van damme wrote:
> That explains it, thank you.
> Now only how come that
> "dmd hello.d" results in a 1.70 mb application whereas
> "dmd -c hello.d" && "dmd hello.obj phobos.lib" results in a 144 kb app
> (sorry for confusion, Turns out I didn't link my app with phobos.lib but
> recompiled the object file with phobos.lib
>
> 2011/8/20 Kagamin <spam@here.lot>
>
> maarten van damme Wrote:
>
> > But where does the lib file searches for the dll file? how can we
> control
> > that? Is my hunch right?
>
> The dll is searched by the system. It's a documented procedure. You
> can control it to some degree by manifest files.
>
>
I cannot reproduce this. I get the same size even if I link manually.
|
August 20, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
On 8/20/11, maarten van damme <maartenvd1994@gmail.com> wrote:
> Now only how come that
> "dmd hello.d" results in a 1.70 mb application whereas
> "dmd -c hello.d" && "dmd hello.obj phobos.lib" results in a 144 kb app
In both cases on my system it produces a 464Kb app. You must be doing something wrong. :)
|
August 20, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On 08/20/2011 04:35 PM, Andrej Mitrovic wrote:
> On 8/20/11, maarten van damme<maartenvd1994@gmail.com> wrote:
>> Now only how come that
>> "dmd hello.d" results in a 1.70 mb application whereas
>> "dmd -c hello.d"&& "dmd hello.obj phobos.lib" results in a 144 kb app
>
> In both cases on my system it produces a 464Kb app. You must be doing
> something wrong. :)
Unless it is a bug of some sort. Maarten, what system are you on? Also, can you provide your hello.d?
Have you tried to strip the executable?
|
August 20, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On 08/20/2011 06:27 PM, Timon Gehr wrote:
> On 08/20/2011 04:35 PM, Andrej Mitrovic wrote:
>> On 8/20/11, maarten van damme<maartenvd1994@gmail.com> wrote:
>>> Now only how come that
>>> "dmd hello.d" results in a 1.70 mb application whereas
>>> "dmd -c hello.d"&& "dmd hello.obj phobos.lib" results in a 144 kb app
>>
>> In both cases on my system it produces a 464Kb app. You must be doing
>> something wrong. :)
>
> Unless it is a bug of some sort. Maarten, what system are you on? Also,
> can you provide your hello.d?
>
> Have you tried to strip the executable?
should have read "have you tried stripping the executable".
|
August 20, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr Attachments:
| hello.d first only used part from druntime, thats when it compiled to 144 kb. If I follow the same procedure with parts from phobos.lib it is 500 kb like yours. I think it is because of my sc.ini. it contatins this: -I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import" "-I%@P%\..\..\src\gtkd\src" "-I%@P%\..\..\src\gtkd\srcsv" "-I%@P%\..\..\src\gtkd\srcgda" "-I%@P%\..\..\src\gtkd\srcgl" "-I%@P%\..\..\src\gtkd\srcgstreamer" "-L %@P%\..\lib\GtkD.lib" "-I%@P%\..\..\src\bindings" "-L %@P%\..\lib\win32.lib" Is it including stuff from that while that's not used? I'm using dmd on windows 7. |
August 22, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Attachments:
| I'm thinking this is a compiler bug as I have reviewed my programs and nearly all of them are 1.7 mb so it includes parts of something in my flags while not needed
2011/8/20 maarten van damme <maartenvd1994@gmail.com>
> hello.d first only used part from druntime, thats when it compiled to 144 kb. If I follow the same procedure with parts from phobos.lib it is 500 kb like yours.
>
> I think it is because of my sc.ini.
> it contatins this:
> -I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import" "-I%@P%\..\..\src\gtkd\src"
> "-I%@P%\..\..\src\gtkd\srcsv" "-I%@P%\..\..\src\gtkd\srcgda" "-I%@P%\..\..\src\gtkd\srcgl"
> "-I%@P%\..\..\src\gtkd\srcgstreamer" "-L %@P%\..\lib\GtkD.lib" "-I%@P%\..\..\src\bindings"
> "-L %@P%\..\lib\win32.lib"
>
> Is it including stuff from that while that's not used?
> I'm using dmd on windows 7.
>
>
>
|
August 22, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
You are explicitly linking to GtkD.lib and win32.lib, that's what's causing the increase in size. |
August 22, 2011 Re: help understanding import libraries | ||||
---|---|---|---|---|
| ||||
Attachments:
| Is there a way to only link against it when it's needed automatically? I was
hoping dmd would do that automatically.
But you're right, it now spits out a 144 kb executable
2011/8/22 Andrej Mitrovic <andrej.mitrovich@gmail.com>
> You are explicitly linking to GtkD.lib and win32.lib, that's what's causing the increase in size.
>
|
Copyright © 1999-2021 by the D Language Foundation