Re: How static link dll msvcr120.dll?

2023-06-01 Thread novice2 via Digitalmars-d-learn

On Thursday, 1 June 2023 at 15:05:40 UTC, Marcone wrote:
I linked msvcr120.lib, but the executable still ask for 
msvcr120.dll not found.



i am sorry.
my words was sourced from common sence, usual practice.
it seems, msvcr120 is special case, and have only one version of 
.lib - for link to .dll

i cant find static lib for msvcr120 :(


Re: How static link dll msvcr120.dll?

2023-06-01 Thread Mike Parker via Digitalmars-d-learn

On Thursday, 1 June 2023 at 15:05:40 UTC, Marcone wrote:



I linked msvcr120.lib, but the executable still ask for 
msvcr120.dll not found.


msvcr120.lib is a "link library", not a static library. On other 
systems, you pass shared libraries directly to the linker and it 
will pull the information it needs from there to set up the 
exectuable with what it needs for the system loader to load the 
shared library at runtime. Windows works differently. The 
compiler puts all that information in a link library when it 
creates the DLL, and you pass that to the linker instead of the 
DLL.


Windows system libraries are not distributed as static libraries 
as far as I know.


Re: How static link dll msvcr120.dll?

2023-06-01 Thread Marcone via Digitalmars-d-learn

On Tuesday, 30 May 2023 at 05:18:11 UTC, novice2 wrote:

you cannot "static link dll", "d" in "dll" is "dynamic".
you can implicity or explicity load dll.

https://learn.microsoft.com/en-us/cpp/build/linking-an-executable-to-a-dll?view=msvc-170

may be you mean static link msvcr120.lib?
i am not windows guru, but you need msvcr120.lib (there is 2 
version of .lib - one small for use .dll and contain only 
reference to code in dll, other large, for static linking, 
contains all code).


to link mylib.lib you can use pragma(lib, "mylib.lib") in D 
code.


I linked msvcr120.lib, but the executable still ask for 
msvcr120.dll not found.


Re: How static link dll msvcr120.dll?

2023-05-29 Thread novice2 via Digitalmars-d-learn

you cannot "static link dll", "d" in "dll" is "dynamic".
you can implicity or explicity load dll.

https://learn.microsoft.com/en-us/cpp/build/linking-an-executable-to-a-dll?view=msvc-170

may be you mean static link msvcr120.lib?
i am not windows guru, but you need msvcr120.lib (there is 2 
version of .lib - one small for use .dll and contain only 
reference to code in dll, other large, for static linking, 
contains all code).


to link mylib.lib you can use pragma(lib, "mylib.lib") in D code.



Re: How static link dll msvcr120.dll?

2023-05-28 Thread Marcone via Digitalmars-d-learn

On Friday, 26 May 2023 at 12:29:15 UTC, Marcone wrote:

How can I static link msvcr120.dll using dmd?


Please, could someone tell me if it is possible to link the 
msvcr120.dll library to the program's executable using the dmd 
compiler? Because I would like my program to remain portable.


How static link dll msvcr120.dll?

2023-05-26 Thread Marcone via Digitalmars-d-learn

How can I static link msvcr120.dll using dmd?