Trying to link a pgf95 compiled module (using v18.7) with a Visutal Studio 2015 C++ project. Currently linking with the following PGI static libraries ( to avoid redistributing .dll’s):
These look like these symbols found in the Microsoft C Static runtime libraries (libcmt.lib, libcrt.lib). Are you linking with the “-Bstatic” flag? This flag will have the linker use the PGI static runtime libraries as well as libcmt.lib/libcrt.lib.
If you’re manually linking, you can use the linker flags “-nodefaultlib:msvcrt -defaultlib:libvcruntime -defaultlib:libucrt -defaultlib:libcmt” to use the MS static runtime.
The above ‘mdl_radcal_dist.obj’ is linked with a much larger C/C++ project which uses the Visual Studio ‘Multi-threaded DLL (/MD)’ Runtime library. This has not prevented us from linking with the static versions of the PGF libraries (listed in my original post) until we tried to migrate up to Visual Studio 2015. Something changed in the Visual Studio 2015 version of the run-time libraries – they no longer use the variables listed
FYI: I took the last VS 2015 compatible version of PGI fortran (PGI Workstation 18.7). At present, we have reverted back to VS 2013 (using PGI Workstation 17.10).
It’s unclear why it works with VS2013. The PGI static runtime libraries are only expected to be used when linking staticly with the MS static C runtime libraries (libcmt.lib, libcrt.lib). When linking a project compiled with “/MD”, the PGI dynamic runtime libraries should be used so the VS2015 behavior is what I would expect.