[CMake] Can't compile a quite simple Fortran static library

Bill Hoffman bill.hoffman at kitware.com
Wed Aug 20 12:08:14 EDT 2008


Bill Hoffman wrote:

> Looking at the buildlog.html that you sent me, I see this:
> 
> ------ Build started: Project: edgepack, Configuration: Debug|Win32 
> ------   Compiling with Intel Fortran 9.1 C:\Arquivos de 
> programas\Intel\Compiler\Fortran\9.1\IA32\...  ifort /nologo /Zi /fpp 
> /define:ASLIB /define:CMAKE_INTDIR=\&quotDebug\" /module:&quot.\Debug" 
> /object:&quotedgepack.dir\Debug\\" /libs:static /threads  /extfor:f 
> /Qvc8 /Qlocation,link,&quotC:\Arquivos de programas\Microsoft Visual 
> Studio 8\VC\bin" 
> &quotC:\users\Renato\svn\EdgeCFD-HEAD\src\EdgePack\block3d.f" 
> libifcoremt.lib(libifcoremain.obj) : error LNK2019: unresolved external 
> symbol _MAIN__ referenced in function _main block3d.exe : fatal error 
> LNK1120: 1 unresolved externals     edgepack build failed.
> 
> 
> So, it is building the static library edgepack, and compiling one of the 
> files block3d.f, but instead of creating block3d.obj, it is trying to 
> create block3d.exe.   The only thing odd I can see is: 
> "/Qlocation,link,&"  It should not have link options for compiling an 
> object file.  However, that does not show up in the .vfproj file at all. 
>  So, it must be some global setting that you have in your visual 
> stduio.   One difference is that Clinton is using Intel 10.1.
> 

OK, so on the one that works we have this:
ifort /nologo /Zi /fpp /DASLIB /DCMAKE_INTDIR=\"Debug\" 
/module:".\Debug" /object:"edgepack.dir\Debug\\" /libs:static /threads 
/c  /W1 /extfor:f /Qvc8 /Qlocation,link,"C:\Program Files 
(x86)\Microsoft Visual Studio 8\VC\bin\x86_amd64" 
"C:\Users\cjstimp\fort\EdgePack\block3d.f"


And the one that does not work we have:

ifort /nologo /Zi /fpp
  /define:ASLIB /define:CMAKE_INTDIR=\&quotDebug\" /module:&quot.\Debug"
/object:&quotedgepack.dir\Debug\\" /libs:static /threads  /extfor:f 
/Qvc8 /Qlocation,link,&quotC:\Arquivos de programas\Microsoft Visual
  Studio 8\VC\bin"
 >&quotC:\users\Renato\svn\EdgeCFD-HEAD\src\EdgePack\block3d.f"

The broken one is missing the /c which would cause the problem.  The 
question now is where did it go??

-Bill


More information about the CMake mailing list