Jim Dishaw wrote:
> In my attempt to get Fortran built correctly using the Intel compiler I
> noticed a problem with the compiler flag string.
> I used the following cmake command
> Notice the presence of the /MD and /MDd flags in the release and debug
> variants. This sets the default library to MSVCRT.DLL and MSVCRTD.DLL,
> which will cause problems if someone was expecting a static library
> version, which is what I thought I was getting with
I think it is possible to replace the /MD flag with /MT (static crt) or
/Zl (no link) in the corresponding variables, this should be no problem.
> For dyanmic libraries I have had problems using the /Zl
> option. From what I understand, all the parts that make up the DLL need
> to have a library specified because the DLL needs to be internally
> consistent. For example, you can create a DLL that consists of static
> linked parts (which makes one DLL that is complete) or you can create a
> DLL that uses the runtime DLL's (e.g. MSVCRT.DLL). I've used the static
> linked version to create DLL's that work.
For dynamic libraries I don't think you can use the /Zl option, since as
you write, there can't be unreferenced dependencies in a dll.
> Another option would be to have a cmake parameter where the user
> specifies which runtime library to use (maybe there is one already).
Other libraries (like wxWidgets) always point out, that you have to
compile your application with the same option as was used for the
library. We could allow the user to change the runtime library (e.g.
-DSTATIC_CRT=ON), but I'm not sure if this is a good idea for the plplot
dll (i.e. don't allow it in that case). Apart from that the c-runtime
library V6 and V7 are really on every Windows computer, you should
virtually never run into problems here. Version 8 is a problem, Vista
will have it by default, but not WinXP an earlier - that's the reason
why you practically can't use Visual C++ 2005 (free version) for
deploying a application (since you are somehow not allowed to include
the runtime library in your application and let the user install it by
herself is a PITA).
Dipl. Ing. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
phone: +43-(0)1-58801-13463 (office)