MantisBT - CMake
View Issue Details
0010803CMakeCMakepublic2010-06-08 22:192011-01-12 07:32
Brian Bassett 
Brad King 
normalmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.4CMake 2.8.4 
0010803: Shared library or module Fortran-only targets do not link correctly in VIsual Studio 2008
When building a shared library or module target consisting of only Fortran sources with the Visual Studio 9 2008 generator, the final link line is missing the /DLL flag. This attempts to link the target as an executable, which fails with an error about unresolved symbols (usually __MAIN_) or a missing entry point.
Environment:
Visual Studio 2008
Intel Visual Fortran 11.1

Using "Visual Studio 9 2008" generator
No tags attached.
zip FortranDLL.zip (678) 2010-06-08 22:19
https://public.kitware.com/Bug/file/3172/FortranDLL.zip
htm BuildLog.htm (4,534) 2010-06-08 22:19
https://public.kitware.com/Bug/file/3173/BuildLog.htm
patch vs_fortrandll.patch (756) 2010-06-08 22:20
https://public.kitware.com/Bug/file/3174/vs_fortrandll.patch
Issue History
2010-06-08 22:19Brian BassettNew Issue
2010-06-08 22:19Brian BassettFile Added: FortranDLL.zip
2010-06-08 22:19Brian BassettFile Added: BuildLog.htm
2010-06-08 22:20Brian BassettFile Added: vs_fortrandll.patch
2010-06-08 22:26Brian BassettNote Added: 0020948
2011-01-05 19:28David ColeAssigned To => Brad King
2011-01-05 19:28David ColeStatusnew => assigned
2011-01-05 19:28David ColeNote Added: 0024444
2011-01-06 07:43Brad KingNote Added: 0024450
2011-01-06 08:13Brad KingNote Added: 0024453
2011-01-06 08:13Brad KingStatusassigned => closed
2011-01-06 08:13Brad KingResolutionopen => fixed
2011-01-12 07:32David ColeFixed in Version => CMake 2.8.4
2011-01-12 07:32David ColeTarget Version => CMake 2.8.4

Notes
(0020948)
Brian Bassett   
2010-06-08 22:26   
Attached is a sample project that will reproduce the issue, along with a build log from a failing run.

The attached patch fixes the issue by making sure that the VFLinkerTool emitted for a Fortran-only DLL project has the LinkDLL attribute set.
(0024444)
David Cole   
2011-01-05 19:28   
Brad, do you know if this is still an issue with git 'master'...?
(0024450)
Brad King   
2011-01-06 07:43   
This commit:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=22aec406 [^]

fixes the RuntimeLibrary attribute but AFAIK we don't set LinkDLL yet.
(0024453)
Brad King   
2011-01-06 08:13   
Patch applied, thanks:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f661b953 [^]