Hi,

> -----Original Message-----
> From: Konstantin Preißer [mailto:kpreis...@apache.org]
> Sent: Friday, July 11, 2014 8:18 PM
> To: 'Tomcat Developers List'
> Subject: RE: Working tc native build
> 
> Hi Christopher,
> 
> > -----Original Message-----
> > From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> > Sent: Friday, July 11, 2014 7:50 PM
> > To: Tomcat Developers List
> > Subject: Re: Working tc native build
> 
> > > For end users the dependency on the dll is not a big problem, because
> > > Microsoft provides it for redistribution or download. Of course we can't
> > > bundle it due to license incompatibility.
> >
> > Any chance that MSVCR100.dll and friends are provided by recent OSs? On
> > my Windows 8 VM I can see these files in /windows/system32:
> >
> > 07/25/2012  11:06 PM            77,824 msvcirt.dll
> > 07/11/2012  10:01 PM           613,840 msvcp110_clr0400.dll
> > 07/25/2012  11:06 PM           572,416 msvcp60.dll
> > 08/30/2012  08:52 PM            17,888 msvcr100_clr0400.dll
> > 07/11/2012  10:01 PM           856,016 msvcr110_clr0400.dll
> > 07/26/2012  01:26 AM           654,848 msvcrt.dll
> >
> > In my particular case, would we need to bundle anything with tcnative?
> 
> I think the above dlls with "_clr0400.dll" are DLLs used by the .Net Framework
> only (at leat their descriptions read "Microsoft® .NET Framework"), so I don't
> think they can/will be used by C++ applications.
> 
> AFAIK, even recent Windows OSes don't contain current Visual C++ Runtime
> libraries by default. Users will need to install the corresponding
> redistributable package - e.g. if you compile with VS 2010, the user will need
> to install the "Microsoft Visual C++ 2010 Redistributable Package" [1] (x86 or
> x64) which e.g. will install "msvcr100.dll" to the windows\system32 directory.
> If you compile with VS 2013, the user will need the "Visual C++
> Redistributable Packages for Visual Studio 2013" [2] (x86 or x64) which e.g.
> installs "msvcr120.dll", and so on.
> 
> However, I don't know why MS doesn't include those runtimes with current
> OSes just like it is done with .Net Framework. (Maybe to reduce
> maintenance when system only needs a specific runtime, but not all, as there
> have been security updates for some C++ Redistributables in the past).
> 
> 
> [1] http://www.microsoft.com/en-us/download/details.aspx?id=14632
> [2] http://www.microsoft.com/en-us/download/details.aspx?id=40784

FJY, When I just tried to compile a simple C++ DLL (exporting simple functions 
to solve a Sudoku) using Visual Studio 2013, the resulting DLL was 11 KB, and 
when using Dependeny Walker [1] view the DLL dependencies, it showed 
"msvcr120.dll" and "kernel32.dll".

However, when I change the project configuration (projectname.vcxproj) from
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" 
Label="Configuration">
    (...)
    <UseOfMfc>false</UseOfMfc>
  </PropertyGroup>

to

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" 
Label="Configuration">
    (...)
    <UseOfMfc>Static</UseOfMfc>
  </PropertyGroup>

and compile the DLL, it has 83 KB instead of 11 KB, and Dependency Walker only 
shows "kernel32.dll", but no VC runtime. I then tested this with a VC++ project 
that will create an .EXE, and with the first option, it will fail to run on a 
fresh Windows 8 system complaining about missing msvcr120.dll; whereas with the 
second option, it will run without any problems. 

So maybe with this option the necessary functions from the C runtime have been 
included in the generated DLL, avoiding a run-time depencency to the VC++ 
runtime DLLs. However, I have only little knowledge about C++ so I cannot 
really comment on how this setting (UseOfMfc) works.


Regards,
Konstantin Preißer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to