[CMake] Can't compile a quite simple Fortran static library
Bill Hoffman
bill.hoffman at kitware.com
Wed Aug 20 09:52:55 EDT 2008
Renato N. Elias wrote:
>
> Hi folks,
>
> I'm trying to use CMake 2.6 to build a Fortran static library in Visual
> Studio 2005 (Fortran Intel Compiler 9.1). All files are in the same
> directory.
>
> My CMakeLists.txt file is:
>
> #================================================
> cmake_minimum_required(VERSION 2.6)
>
> PROJECT(edgepack_lib Fortran)
>
> FILE(GLOB SRC_FILES *.f)
>
> ADD_DEFINITIONS(-DASLIB)
>
> ADD_LIBRARY(edgepack STATIC ${SRC_FILES})
> #==================================================
>
>
> CMake 2.6 successfully creates the Visual Studio project but, when I hit
> the build button, I get the following error message:
>
>
> 1>------ Build started: Project: edgepack, Configuration: Debug Win32
> ------
> 1>Compiling with Intel Fortran 9.1 C:\Arquivos de
> programas\Intel\Compiler\Fortran\9.1\IA32\...
> 1>..\..\src\EdgePack\block3d.f
> 1>libifcoremt.lib(libifcoremain.obj) : error LNK2019: unresolved
> external symbol _MAIN__ referenced in function _main
> 1>block3d.exe : fatal error LNK1120: 1 unresolved externals
> 1>
> 1>Build log written to
> "file://C:\users\Renato\svn\EdgeCFD-HEAD\CMake-tests\EdgePack\Debug\BuildLog.htm"
>
> 1>edgepack build failed.
> 1>
> 2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32
> ------
> 2>Project not selected to build for this solution configuration
> ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 1 skipped ==========
>
>
Strange, looks like it is trying to create block3d.exe. Can you send
me the generated project files?
Thanks.
-Bill
--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518-371-3971 (phone and fax)
More information about the CMake
mailing list